diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2008-08-21 20:05:56 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2008-08-21 20:05:56 (GMT) |
commit | 589b795986760cbe391d70b33bfd5ca424eabdb1 (patch) | |
tree | ae5c39a1dc2491afa93420513ab7cb6d28177986 | |
parent | 9b6760225a21e336418a55a86f3b6dfdc37cef56 (diff) | |
download | cpython-589b795986760cbe391d70b33bfd5ca424eabdb1.zip cpython-589b795986760cbe391d70b33bfd5ca424eabdb1.tar.gz cpython-589b795986760cbe391d70b33bfd5ca424eabdb1.tar.bz2 |
Merged revisions 65958 via svnmerge from
svn+ssh://pythondev@svn.python.org/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
........
-rw-r--r-- | Lib/test/test_float.py | 8 |
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): |