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

Method test_object_to_timespec

Lib/test/test_time.py:1179–1193  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1177 _PyTime_ObjectToTimeval(float('nan'), time_rnd)
1178
1179 def test_object_to_timespec(self):
1180 from _testinternalcapi import _PyTime_ObjectToTimespec
1181
1182 self.check_int_rounding(_PyTime_ObjectToTimespec,
1183 lambda secs: (secs, 0),
1184 value_filter=self.time_t_filter)
1185
1186 self.check_float_rounding(_PyTime_ObjectToTimespec,
1187 self.create_converter(SEC_TO_NS),
1188 value_filter=self.time_t_filter)
1189
1190 # test nan
1191 for time_rnd, _ in ROUNDING_MODES:
1192 with self.assertRaises(ValueError):
1193 _PyTime_ObjectToTimespec(float('nan'), time_rnd)
1194
1195@unittest.skipUnless(sys.platform == "darwin", "test weak linking on macOS")
1196class TestTimeWeaklinking(unittest.TestCase):

Callers

nothing calls this directly

Calls 4

create_converterMethod · 0.95
check_int_roundingMethod · 0.80
check_float_roundingMethod · 0.80
assertRaisesMethod · 0.45

Tested by

no test coverage detected