Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 589b795

Browse files
committed
Merged revisions 65958 via svnmerge from
svn+ssh://[email protected]/python/trunk ........ r65958 | mark.dickinson | 2008-08-21 21:02:24 +0100 (Thu, 21 Aug 2008) | 5 lines Fix float.fromhex test to give additional information on failure. This change is aimed at diagnosing issue 3633 (test_float fails on Solaris). Reviewed by Benjamin Peterson ........
1 parent 9b67602 commit 589b795

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

Lib/test/test_float.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,13 @@ def test_invalid_inputs(self):
448448
'0x1p0\0 0x1p0', # embedded null byte is not end of string
449449
]
450450
for x in invalid_inputs:
451-
self.assertRaises(ValueError, fromHex, x)
451+
try:
452+
result = fromHex(x)
453+
except ValueError:
454+
pass
455+
else:
456+
self.fail('Expected float.fromhex(%r) to raise ValueError; '
457+
'got %r instead' % (x, result))
452458

453459

454460
def test_from_hex(self):

0 commit comments

Comments
 (0)