summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_float.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/test/test_float.py b/Lib/test/test_float.py
index db91e5e..cad745b 100644
--- a/Lib/test/test_float.py
+++ b/Lib/test/test_float.py
@@ -448,7 +448,13 @@ class HexFloatTestCase(unittest.TestCase):
'0x1p0\0 0x1p0', # embedded null byte is not end of string
]
for x in invalid_inputs:
- self.assertRaises(ValueError, fromHex, x)
+ try:
+ result = fromHex(x)
+ except ValueError:
+ pass
+ else:
+ self.fail('Expected float.fromhex(%r) to raise ValueError; '
+ 'got %r instead' % (x, result))
def test_from_hex(self):