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

Method test_date_from_timestamp

Lib/test/datetimetester.py:7326–7333  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

7324 self.assertEqual(c_api_delta, exp_delta)
7325
7326 def test_date_from_timestamp(self):
7327 ts = datetime(1995, 4, 12).timestamp()
7328
7329 for macro in False, True:
7330 with self.subTest(macro=macro):
7331 d = _testcapi.get_date_fromtimestamp(int(ts), macro)
7332
7333 self.assertEqual(d, date(1995, 4, 12))
7334
7335 def test_datetime_from_timestamp(self):
7336 cases = [

Callers

nothing calls this directly

Calls 5

datetimeClass · 0.90
dateClass · 0.90
timestampMethod · 0.80
subTestMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected