summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_format.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_format.py')
-rw-r--r--Lib/test/test_format.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_format.py b/Lib/test/test_format.py
index f39426b..dd30efa 100644
--- a/Lib/test/test_format.py
+++ b/Lib/test/test_format.py
@@ -234,6 +234,16 @@ class FormatTest(unittest.TestCase):
testformat('%g', 1.1, '1.1')
testformat('%#g', 1.1, '1.10000')
+ # Regression test for http://bugs.python.org/issue15516.
+ class IntFails(object):
+ def __int__(self):
+ raise TestFailed
+ def __long__(self):
+ return 0
+
+ fst = IntFails()
+ testformat("%x", fst, '0')
+
# Test exception for unknown format characters
if verbose:
print 'Testing exceptions'