Update of /cvsroot/python/python/nondist/sandbox/twister In directory sc8-pr-cvs1:/tmp/cvs-serv19212 Modified Files: test_random.py Log Message: Use unittest's new assertAlmostEqual method. Index: test_random.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/twister/test_random.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** test_random.py 29 Dec 2002 10:50:23 -0000 1.9 --- test_random.py 29 Dec 2002 18:02:01 -0000 1.10 *************** *** 116,120 **** actual = self.randomlist(2000)[-10:] for a, e in zip(actual, expected): ! self.assertEqual(round(a-e, 14), 0) def test_strong_reference_implementation(self): --- 116,120 ---- actual = self.randomlist(2000)[-10:] for a, e in zip(actual, expected): ! self.assertAlmostEqual(a,e,places=14) def test_strong_reference_implementation(self): *************** *** 151,158 **** class TestModule(unittest.TestCase): - def assertAlmostEqual(self, computed, expected): - """Helper function to test constants being within a given tolerance""" - self.failIf(abs(computed - expected) > 1e-7) - def testMagicConstants(self): self.assertAlmostEqual(random.NV_MAGICCONST, 1.71552776992141) --- 151,154 ----
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4