summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_cmath.py
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2010-11-20 11:08:27 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2010-11-20 11:08:27 (GMT)
commit4ccc137affe960741c3f6758ce00277d15409665 (patch)
tree9f3eb0388baf48bca4d17a96779c371c16b308af /Lib/test/test_cmath.py
parent6646cd45be26c532a1152cea6a6e0ba27838c645 (diff)
downloadcpython-4ccc137affe960741c3f6758ce00277d15409665.zip
cpython-4ccc137affe960741c3f6758ce00277d15409665.tar.gz
cpython-4ccc137affe960741c3f6758ce00277d15409665.tar.bz2
Issue #9920: Skip tests for cmath.atan and cmath.atanh applied to
complex zeros on systems where the log1p function fails to respect the sign of zero. This fixes a test failure on AIX.
Diffstat (limited to 'Lib/test/test_cmath.py')
-rw-r--r--Lib/test/test_cmath.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/Lib/test/test_cmath.py b/Lib/test/test_cmath.py
index 0d12635..168b513 100644
--- a/Lib/test/test_cmath.py
+++ b/Lib/test/test_cmath.py
@@ -514,6 +514,24 @@ class CMathTests(unittest.TestCase):
for z in complex_zeros:
self.assertComplexIdentical(cmath.tanh(z), z)
+ # The algorithm used for atan and atanh makes use of the system
+ # log1p function; If that system function doesn't respect the sign
+ # of zero, then atan and atanh will also have difficulties with
+ # the sign of complex zeros.
+ @requires_IEEE_754
+ @unittest.skipIf(sysconfig.get_config_var('LOG1P_DROPS_ZERO_SIGN'),
+ "system log1p() function doesn't preserve the sign")
+ def testAtanSign(self):
+ for z in complex_zeros:
+ self.assertComplexIdentical(cmath.atan(z), z)
+
+ @requires_IEEE_754
+ @unittest.skipIf(sysconfig.get_config_var('LOG1P_DROPS_ZERO_SIGN'),
+ "system log1p() function doesn't preserve the sign")
+ def testAtanhSign(self):
+ for z in complex_zeros:
+ self.assertComplexIdentical(cmath.atanh(z), z)
+
def test_main():
run_unittest(CMathTests)