MCPcopy Index your code
hub / github.com/python/cpython / test_floatenum_fromhex

Method test_floatenum_fromhex

Lib/test/test_enum.py:1662–1667  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1660
1661 @reraise_if_not_enum(FloatStooges)
1662 def test_floatenum_fromhex(self):
1663 h = float.hex(FloatStooges.MOE.value)
1664 self.assertIs(FloatStooges.fromhex(h), FloatStooges.MOE)
1665 h = float.hex(FloatStooges.MOE.value + 0.01)
1666 with self.assertRaises(ValueError):
1667 FloatStooges.fromhex(h)
1668
1669 def test_programmatic_function_type(self):
1670 MinorEnum = Enum('MinorEnum', 'june july august', type=int)

Callers

nothing calls this directly

Calls 3

hexMethod · 0.45
assertIsMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected