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

Method test_non_abstractness

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

Source from the content-addressed store, hash-verified

174 dt1.utcoffset()
175
176 def test_non_abstractness(self):
177 # In order to allow subclasses to get pickled, the C implementation
178 # wasn't able to get away with having __init__ raise
179 # NotImplementedError.
180 useless = tzinfo()
181 dt = datetime.max
182 self.assertRaises(NotImplementedError, useless.tzname, dt)
183 self.assertRaises(NotImplementedError, useless.utcoffset, dt)
184 self.assertRaises(NotImplementedError, useless.dst, dt)
185
186 def test_subclass_must_override(self):
187 class NotEnough(tzinfo):

Callers

nothing calls this directly

Calls 2

tzinfoClass · 0.90
assertRaisesMethod · 0.45

Tested by

no test coverage detected