summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_long.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_long.py')
-rw-r--r--Lib/test/test_long.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/Lib/test/test_long.py b/Lib/test/test_long.py
index 3b6081e..b0eaff7 100644
--- a/Lib/test/test_long.py
+++ b/Lib/test/test_long.py
@@ -314,10 +314,19 @@ def test_auto_overflow():
checkit(x, '**', y)
for z in special:
- if z != 0:
- expected = pow(longx, longy, long(z))
- got = pow(x, y, z)
- checkit('pow', x, y, '%', z)
+ if z != 0 :
+ if y >= 0:
+ expected = pow(longx, longy, long(z))
+ got = pow(x, y, z)
+ checkit('pow', x, y, '%', z)
+ else:
+ try:
+ pow(longx, longy, long(z))
+ except TypeError:
+ pass
+ else:
+ raise TestFailed("pow%r should have raised "
+ "TypeError" % ((longx, longy, long(z))))
# ---------------------------------------------------------------- do it