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

Method test_utcfromtimestamp

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

Source from the content-addressed store, hash-verified

2671 self.theclass.fromtimestamp(timestamp=time.time())
2672
2673 def test_utcfromtimestamp(self):
2674 import time
2675
2676 ts = time.time()
2677 expected = time.gmtime(ts)
2678 with self.assertWarns(DeprecationWarning):
2679 got = self.theclass.utcfromtimestamp(ts)
2680 self.verify_field_equality(expected, got)
2681 with self.assertWarns(DeprecationWarning):
2682 got = self.theclass.utcfromtimestamp(decimal.Decimal(ts))
2683 self.verify_field_equality(expected, got)
2684 with self.assertWarns(DeprecationWarning):
2685 got = self.theclass.utcfromtimestamp(fractions.Fraction(ts))
2686 self.verify_field_equality(expected, got)
2687
2688 # Run with US-style DST rules: DST begins 2 a.m. on second Sunday in
2689 # March (M3.2.0) and ends 2 a.m. on first Sunday in November (M11.1.0).

Callers

nothing calls this directly

Calls 4

verify_field_equalityMethod · 0.95
assertWarnsMethod · 0.80
timeMethod · 0.45
utcfromtimestampMethod · 0.45

Tested by

no test coverage detected