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

Method test_repr_subclass

Lib/test/datetimetester.py:3806–3813  ·  view source on GitHub ↗

Subclasses should have bare names in the repr (gh-107773).

(self)

Source from the content-addressed store, hash-verified

3804 self.assertIsInstance(dt_rt, DateTimeSubclass)
3805
3806 def test_repr_subclass(self):
3807 """Subclasses should have bare names in the repr (gh-107773)."""
3808 td = SubclassDatetime(2014, 1, 1)
3809 self.assertEqual(repr(td), "SubclassDatetime(2014, 1, 1, 0, 0)")
3810 td = SubclassDatetime(2010, 10, day=10)
3811 self.assertEqual(repr(td), "SubclassDatetime(2010, 10, 10, 0, 0)")
3812 td = SubclassDatetime(2010, 10, 2, second=3)
3813 self.assertEqual(repr(td), "SubclassDatetime(2010, 10, 2, 0, 0, 3)")
3814
3815 def test_strptime_T_format(self):
3816 test_time = "15:00:00"

Callers

nothing calls this directly

Calls 2

SubclassDatetimeClass · 0.85
assertEqualMethod · 0.45

Tested by

no test coverage detected