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

Method test_aware_datetime

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

Source from the content-addressed store, hash-verified

388 self.assertTrue(tz >= SMALLEST)
389
390 def test_aware_datetime(self):
391 # test that timezone instances can be used by datetime
392 t = datetime(1, 1, 1)
393 for tz in [timezone.min, timezone.max, timezone.utc]:
394 self.assertEqual(tz.tzname(t),
395 t.replace(tzinfo=tz).tzname())
396 self.assertEqual(tz.utcoffset(t),
397 t.replace(tzinfo=tz).utcoffset())
398 self.assertEqual(tz.dst(t),
399 t.replace(tzinfo=tz).dst())
400
401 def test_pickle(self):
402 for tz in self.ACDT, self.EST, timezone.min, timezone.max:

Callers

nothing calls this directly

Calls 6

datetimeClass · 0.90
assertEqualMethod · 0.45
tznameMethod · 0.45
replaceMethod · 0.45
utcoffsetMethod · 0.45
dstMethod · 0.45

Tested by

no test coverage detected