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

Method test_subclass_must_override

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

Source from the content-addressed store, hash-verified

179 self.assertRaises(NotImplementedError, useless.dst, dt)
180
181 def test_subclass_must_override(self):
182 class NotEnough(tzinfo):
183 def __init__(self, offset, name):
184 self.__offset = offset
185 self.__name = name
186 self.assertIsSubclass(NotEnough, tzinfo)
187 ne = NotEnough(3, "NotByALongShot")
188 self.assertIsInstance(ne, tzinfo)
189
190 dt = datetime.now()
191 self.assertRaises(NotImplementedError, ne.tzname, dt)
192 self.assertRaises(NotImplementedError, ne.utcoffset, dt)
193 self.assertRaises(NotImplementedError, ne.dst, dt)
194
195 def test_normal(self):
196 fo = FixedOffset(3, "Three")

Callers

nothing calls this directly

Calls 5

assertIsInstanceMethod · 0.80
nowMethod · 0.80
NotEnoughClass · 0.70
assertIsSubclassMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected