diff options
author | Eric Smith <eric@trueblade.com> | 2010-12-04 15:17:38 (GMT) |
---|---|---|
committer | Eric Smith <eric@trueblade.com> | 2010-12-04 15:17:38 (GMT) |
commit | 3ab08cadaebd694533edee03ad2b4eba2055d4e3 (patch) | |
tree | 800efe09ec68445facc140614c7c7420a51c80a4 /Lib/test/test_cmath.py | |
parent | 932e49e3946901f3e2d05f25e407b6be84dac161 (diff) | |
download | cpython-3ab08cadaebd694533edee03ad2b4eba2055d4e3.zip cpython-3ab08cadaebd694533edee03ad2b4eba2055d4e3.tar.gz cpython-3ab08cadaebd694533edee03ad2b4eba2055d4e3.tar.bz2 |
Issue #10624: Use support.requires_IEEE_754 in all appropriate tests.
Diffstat (limited to 'Lib/test/test_cmath.py')
-rw-r--r-- | Lib/test/test_cmath.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Lib/test/test_cmath.py b/Lib/test/test_cmath.py index 168b513..4e93be4 100644 --- a/Lib/test/test_cmath.py +++ b/Lib/test/test_cmath.py @@ -1,5 +1,5 @@ -from test.support import run_unittest -from test.test_math import parse_testfile, test_file, requires_IEEE_754 +from test.support import run_unittest, requires_IEEE_754 +from test.test_math import parse_testfile, test_file import unittest import cmath, math from cmath import phase, polar, rect, pi @@ -312,10 +312,8 @@ class CMathTests(unittest.TestCase): self.rAssertAlmostEqual(math.log(v, base), z.real) self.assertEqual(0., z.imag) + @requires_IEEE_754 def test_specific_values(self): - if not float.__getformat__("double").startswith("IEEE"): - return - def rect_complex(z): """Wrapped version of rect that accepts a complex number instead of two float arguments.""" @@ -460,9 +458,11 @@ class CMathTests(unittest.TestCase): self.assertEqual(abs(complex(INF, NAN)), INF) self.assertTrue(math.isnan(abs(complex(NAN, NAN)))) + + @requires_IEEE_754 + def test_abs_overflows(self): # result overflows - if float.__getformat__("double").startswith("IEEE"): - self.assertRaises(OverflowError, abs, complex(1.4e308, 1.4e308)) + self.assertRaises(OverflowError, abs, complex(1.4e308, 1.4e308)) def assertCEqual(self, a, b): eps = 1E-7 |