[Python-checkins] r65958 - python/trunk/Lib/test/test_float.py

mark.dickinson python-checkins at python.org
Thu Aug 21 22:02:25 CEST 2008


Author: mark.dickinson
Date: Thu Aug 21 22:02:24 2008
New Revision: 65958

Log:
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


Modified:
   python/trunk/Lib/test/test_float.py

Modified: python/trunk/Lib/test/test_float.py
==============================================================================
--- python/trunk/Lib/test/test_float.py	(original)
+++ python/trunk/Lib/test/test_float.py	Thu Aug 21 22:02:24 2008
@@ -417,7 +417,13 @@
             '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):


More information about the Python-checkins mailing list