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

Class Badtzname

Lib/test/datetimetester.py:4439–4441  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4437
4438 # Check that an invalid tzname result raises an exception.
4439 class Badtzname(tzinfo):
4440 tz = 42
4441 def tzname(self, dt): return self.tz
4442 t = time(2, 3, 4, tzinfo=Badtzname())
4443 self.assertEqual(t.strftime("%H:%M:%S"), "02:03:04")
4444 self.assertRaises(TypeError, t.strftime, "%Z")

Callers 1

test_zonesMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_zonesMethod · 0.68