summaryrefslogtreecommitdiff
path: root/Lib/test/test_int.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_int.py')
-rw-r--r--Lib/test/test_int.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_int.py b/Lib/test/test_int.py
index afc91699a9..492123000b 100644
--- a/Lib/test/test_int.py
+++ b/Lib/test/test_int.py
@@ -354,6 +354,12 @@ class IntTestCases(unittest.TestCase):
return 42
self.assertEqual(int(JustTrunc()), 42)
+ class ExceptionalTrunc(base):
+ def __trunc__(self):
+ 1 / 0
+ with self.assertRaises(ZeroDivisionError):
+ int(ExceptionalTrunc())
+
for trunc_result_base in (object, Classic):
class Integral(trunc_result_base):
def __int__(self):