summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_int.py
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2013-04-13 16:46:04 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2013-04-13 16:46:04 (GMT)
commit93196eb44f935de8132fd79e8be215657ea6b600 (patch)
tree973f08b65f19f2d48d33bde4734080caf16798f5 /Lib/test/test_int.py
parent171bb26b32a30d782fdb63d1f1bcb4aa72460944 (diff)
parentc9734484ca774afad49e361f72cad60d937acf1b (diff)
downloadcpython-93196eb44f935de8132fd79e8be215657ea6b600.zip
cpython-93196eb44f935de8132fd79e8be215657ea6b600.tar.gz
cpython-93196eb44f935de8132fd79e8be215657ea6b600.tar.bz2
Issue #17715: Merge fix from 3.3.
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 afc9169..4921230 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):