]> granicus.if.org Git - python/commitdiff
Streamline a cmath test (and fix some overlong lines into the bargain).
authorMark Dickinson <dickinsm@gmail.com>
Sat, 13 Nov 2010 10:43:40 +0000 (10:43 +0000)
committerMark Dickinson <dickinsm@gmail.com>
Sat, 13 Nov 2010 10:43:40 +0000 (10:43 +0000)
Lib/test/test_cmath.py

index 15f635f56245cb6984205a9e9809dfbe544b9187..0d12635295fbf3b8fd0dcf1e30eb2d68dd109fc5 100644 (file)
@@ -511,10 +511,8 @@ class CMathTests(unittest.TestCase):
     @unittest.skipIf(sysconfig.get_config_var('TANH_PRESERVES_ZERO_SIGN') == 0,
                      "system tanh() function doesn't copy the sign")
     def testTanhSign(self):
-        self.assertComplexIdentical(cmath.tanh(complex(0., .0j)), complex(0., .0j))
-        self.assertComplexIdentical(cmath.tanh(complex(0., -.0j)), complex(0., -.0j))
-        self.assertComplexIdentical(cmath.tanh(complex(-0., .0j)), complex(-0., .0j))
-        self.assertComplexIdentical(cmath.tanh(complex(-0., -.0j)), complex(-0., -.0j))
+        for z in complex_zeros:
+            self.assertComplexIdentical(cmath.tanh(z), z)
 
 
 def test_main():