MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_fromisoformat_subclass

Method test_fromisoformat_subclass

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

Source from the content-addressed store, hash-verified

3623 self.assertIs(dt.tzinfo, timezone.utc)
3624
3625 def test_fromisoformat_subclass(self):
3626 class DateTimeSubclass(self.theclass):
3627 pass
3628
3629 dt = DateTimeSubclass(2014, 12, 14, 9, 30, 45, 457390,
3630 tzinfo=timezone(timedelta(hours=10, minutes=45)))
3631
3632 dt_rt = DateTimeSubclass.fromisoformat(dt.isoformat())
3633
3634 self.assertEqual(dt, dt_rt)
3635 self.assertIsInstance(dt_rt, DateTimeSubclass)
3636
3637 def test_repr_subclass(self):
3638 """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