(self)
| 979 | OVERFLOW_SECONDS = math.ceil((2**63 + 1) / SEC_TO_NS) |
| 980 | |
| 981 | def test_FromSeconds(self): |
| 982 | from _testinternalcapi import _PyTime_FromSeconds |
| 983 | |
| 984 | # _PyTime_FromSeconds() expects a C int, reject values out of range |
| 985 | def c_int_filter(secs): |
| 986 | return (_testcapi.INT_MIN <= secs <= _testcapi.INT_MAX) |
| 987 | |
| 988 | self.check_int_rounding(lambda secs, rnd: _PyTime_FromSeconds(secs), |
| 989 | lambda secs: secs * SEC_TO_NS, |
| 990 | value_filter=c_int_filter) |
| 991 | |
| 992 | # test nan |
| 993 | for time_rnd, _ in ROUNDING_MODES: |
| 994 | with self.assertRaises(TypeError): |
| 995 | _PyTime_FromSeconds(float('nan')) |
| 996 | |
| 997 | def test_FromSecondsObject(self): |
| 998 | from _testinternalcapi import _PyTime_FromSecondsObject |
nothing calls this directly
no test coverage detected