Fix Float unittest for Python < 2.6 that doesn't have hex method
This commit is contained in:
@@ -372,7 +372,9 @@ class ProtocolsDatatypeFloatTestCase(unittest.TestCase):
|
||||
'''
|
||||
Test float only method
|
||||
'''
|
||||
self.assertEqual(Float('1.5').hex(), '0x1.8000000000000p+0')
|
||||
# For Python < 2.6
|
||||
if hasattr(float, 'hex'):
|
||||
self.assertEqual(Float('1.5').hex(), '0x1.8000000000000p+0')
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromTestCase(ProtocolsDatatypeFloatTestCase)
|
||||
|
||||
Reference in New Issue
Block a user