summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/test/test_complex.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_complex.py b/Lib/test/test_complex.py
index b057121..fa3017b 100644
--- a/Lib/test/test_complex.py
+++ b/Lib/test/test_complex.py
@@ -10,6 +10,7 @@ import operator
INF = float("inf")
NAN = float("nan")
+DBL_MAX = sys.float_info.max
# These tests ensure that complex math does the right thing
ZERO_DIVISION = (
@@ -597,6 +598,8 @@ class ComplexTest(unittest.TestCase):
for num in nums:
self.assertAlmostEqual((num.real**2 + num.imag**2) ** 0.5, abs(num))
+ self.assertRaises(OverflowError, abs, complex(DBL_MAX, DBL_MAX))
+
def test_repr_str(self):
def test(v, expected, test_fn=self.assertEqual):
test_fn(repr(v), expected)