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

Method test_AsSecondsDouble

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

Source from the content-addressed store, hash-verified

1011 _PyTime_FromSecondsObject(float('nan'), time_rnd)
1012
1013 def test_AsSecondsDouble(self):
1014 from _testcapi import PyTime_AsSecondsDouble
1015
1016 def float_converter(ns):
1017 if abs(ns) % SEC_TO_NS == 0:
1018 return float(ns // SEC_TO_NS)
1019 else:
1020 return float(ns) / SEC_TO_NS
1021
1022 self.check_int_rounding(lambda ns, rnd: PyTime_AsSecondsDouble(ns),
1023 float_converter,
1024 NS_TO_SEC)
1025
1026 def create_decimal_converter(self, denominator):
1027 denom = decimal.Decimal(denominator)

Callers

nothing calls this directly

Calls 1

check_int_roundingMethod · 0.80

Tested by

no test coverage detected