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

Method test_object_to_timeval

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

Source from the content-addressed store, hash-verified

1161 return converter
1162
1163 def test_object_to_timeval(self):
1164 from _testinternalcapi import _PyTime_ObjectToTimeval
1165
1166 self.check_int_rounding(_PyTime_ObjectToTimeval,
1167 lambda secs: (secs, 0),
1168 value_filter=self.time_t_filter)
1169
1170 self.check_float_rounding(_PyTime_ObjectToTimeval,
1171 self.create_converter(SEC_TO_US),
1172 value_filter=self.time_t_filter)
1173
1174 # test nan
1175 for time_rnd, _ in ROUNDING_MODES:
1176 with self.assertRaises(ValueError):
1177 _PyTime_ObjectToTimeval(float('nan'), time_rnd)
1178
1179 def test_object_to_timespec(self):
1180 from _testinternalcapi import _PyTime_ObjectToTimespec

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