diff options
author | Georg Brandl <georg@python.org> | 2009-08-13 08:51:18 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-08-13 08:51:18 (GMT) |
commit | ab91fdef1f1e556203a2eee98ba7d379e4790de9 (patch) | |
tree | 6f8f00dc18cc5f2801a675df277c2c595eb85ec8 /Lib/test/test_cmath.py | |
parent | ef82be368abdea8e8032500e7ecc3a22f5f07851 (diff) | |
download | cpython-ab91fdef1f1e556203a2eee98ba7d379e4790de9.zip cpython-ab91fdef1f1e556203a2eee98ba7d379e4790de9.tar.gz cpython-ab91fdef1f1e556203a2eee98ba7d379e4790de9.tar.bz2 |
Merged revisions 73715 via svnmerge from
svn+ssh://svn.python.org/python/branches/py3k
........
r73715 | benjamin.peterson | 2009-07-01 01:06:06 +0200 (Mi, 01 Jul 2009) | 1 line
convert old fail* assertions to assert*
........
Diffstat (limited to 'Lib/test/test_cmath.py')
-rwxr-xr-x | Lib/test/test_cmath.py | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/Lib/test/test_cmath.py b/Lib/test/test_cmath.py index 17cb566..2d2deff 100755 --- a/Lib/test/test_cmath.py +++ b/Lib/test/test_cmath.py @@ -412,7 +412,7 @@ class CMathTests(unittest.TestCase): # real or imaginary part NaN for z in complex_nans: - self.assert_(math.isnan(phase(z))) + self.assertTrue(math.isnan(phase(z))) def test_abs(self): # zeros @@ -425,18 +425,18 @@ class CMathTests(unittest.TestCase): # real or imaginary part NaN self.assertEqual(abs(complex(NAN, -INF)), INF) - self.assert_(math.isnan(abs(complex(NAN, -2.3)))) - self.assert_(math.isnan(abs(complex(NAN, -0.0)))) - self.assert_(math.isnan(abs(complex(NAN, 0.0)))) - self.assert_(math.isnan(abs(complex(NAN, 2.3)))) + self.assertTrue(math.isnan(abs(complex(NAN, -2.3)))) + self.assertTrue(math.isnan(abs(complex(NAN, -0.0)))) + self.assertTrue(math.isnan(abs(complex(NAN, 0.0)))) + self.assertTrue(math.isnan(abs(complex(NAN, 2.3)))) self.assertEqual(abs(complex(NAN, INF)), INF) self.assertEqual(abs(complex(-INF, NAN)), INF) - self.assert_(math.isnan(abs(complex(-2.3, NAN)))) - self.assert_(math.isnan(abs(complex(-0.0, NAN)))) - self.assert_(math.isnan(abs(complex(0.0, NAN)))) - self.assert_(math.isnan(abs(complex(2.3, NAN)))) + self.assertTrue(math.isnan(abs(complex(-2.3, NAN)))) + self.assertTrue(math.isnan(abs(complex(-0.0, NAN)))) + self.assertTrue(math.isnan(abs(complex(0.0, NAN)))) + self.assertTrue(math.isnan(abs(complex(2.3, NAN)))) self.assertEqual(abs(complex(INF, NAN)), INF) - self.assert_(math.isnan(abs(complex(NAN, NAN)))) + self.assertTrue(math.isnan(abs(complex(NAN, NAN)))) # result overflows if float.__getformat__("double").startswith("IEEE"): @@ -455,26 +455,26 @@ class CMathTests(unittest.TestCase): self.assertCEqual(rect(1, -pi/2), (0, -1.)) def test_isnan(self): - self.failIf(cmath.isnan(1)) - self.failIf(cmath.isnan(1j)) - self.failIf(cmath.isnan(INF)) - self.assert_(cmath.isnan(NAN)) - self.assert_(cmath.isnan(complex(NAN, 0))) - self.assert_(cmath.isnan(complex(0, NAN))) - self.assert_(cmath.isnan(complex(NAN, NAN))) - self.assert_(cmath.isnan(complex(NAN, INF))) - self.assert_(cmath.isnan(complex(INF, NAN))) + self.assertFalse(cmath.isnan(1)) + self.assertFalse(cmath.isnan(1j)) + self.assertFalse(cmath.isnan(INF)) + self.assertTrue(cmath.isnan(NAN)) + self.assertTrue(cmath.isnan(complex(NAN, 0))) + self.assertTrue(cmath.isnan(complex(0, NAN))) + self.assertTrue(cmath.isnan(complex(NAN, NAN))) + self.assertTrue(cmath.isnan(complex(NAN, INF))) + self.assertTrue(cmath.isnan(complex(INF, NAN))) def test_isinf(self): - self.failIf(cmath.isinf(1)) - self.failIf(cmath.isinf(1j)) - self.failIf(cmath.isinf(NAN)) - self.assert_(cmath.isinf(INF)) - self.assert_(cmath.isinf(complex(INF, 0))) - self.assert_(cmath.isinf(complex(0, INF))) - self.assert_(cmath.isinf(complex(INF, INF))) - self.assert_(cmath.isinf(complex(NAN, INF))) - self.assert_(cmath.isinf(complex(INF, NAN))) + self.assertFalse(cmath.isinf(1)) + self.assertFalse(cmath.isinf(1j)) + self.assertFalse(cmath.isinf(NAN)) + self.assertTrue(cmath.isinf(INF)) + self.assertTrue(cmath.isinf(complex(INF, 0))) + self.assertTrue(cmath.isinf(complex(0, INF))) + self.assertTrue(cmath.isinf(complex(INF, INF))) + self.assertTrue(cmath.isinf(complex(NAN, INF))) + self.assertTrue(cmath.isinf(complex(INF, NAN))) def test_main(): |