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

Method test_fromisoformat_subclass

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

Source from the content-addressed store, hash-verified

3792 self.assertIs(dt.tzinfo, timezone.utc)
3793
3794 def test_fromisoformat_subclass(self):
3795 class DateTimeSubclass(self.theclass):
3796 pass
3797
3798 dt = DateTimeSubclass(2014, 12, 14, 9, 30, 45, 457390,
3799 tzinfo=timezone(timedelta(hours=10, minutes=45)))
3800
3801 dt_rt = DateTimeSubclass.fromisoformat(dt.isoformat())
3802
3803 self.assertEqual(dt, dt_rt)
3804 self.assertIsInstance(dt_rt, DateTimeSubclass)
3805
3806 def test_repr_subclass(self):
3807 """Subclasses should have bare names in the repr (gh-107773)."""

Callers

nothing calls this directly

Calls 7

timezoneClass · 0.90
timedeltaClass · 0.90
assertIsInstanceMethod · 0.80
DateTimeSubclassClass · 0.70
fromisoformatMethod · 0.45
isoformatMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected