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

Method test_fromtimestamp

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

Source from the content-addressed store, hash-verified

1438 self.assertRaises(OverflowError, dt.__sub__, -delta)
1439
1440 def test_fromtimestamp(self):
1441 import time
1442
1443 # Try an arbitrary fixed value.
1444 year, month, day = 1999, 9, 19
1445 ts = time.mktime((year, month, day, 0, 0, 0, 0, 0, -1))
1446 d = self.theclass.fromtimestamp(ts)
1447 self.assertEqual(d.year, year)
1448 self.assertEqual(d.month, month)
1449 self.assertEqual(d.day, day)
1450
1451 def test_insane_fromtimestamp(self):
1452 # It's possible that some platform maps time_t to double,

Callers

nothing calls this directly

Calls 2

fromtimestampMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected