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

Class Badtzname

Lib/test/datetimetester.py:4621–4623  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4619
4620 # Check that an invalid tzname result raises an exception.
4621 class Badtzname(tzinfo):
4622 tz = 42
4623 def tzname(self, dt): return self.tz
4624 t = time(2, 3, 4, tzinfo=Badtzname())
4625 self.assertEqual(t.strftime("%H:%M:%S"), "02:03:04")
4626 self.assertRaises(TypeError, t.strftime, "%Z")

Callers 1

test_zonesMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_zonesMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…