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

Method test_strptime_errors

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

Source from the content-addressed store, hash-verified

4244 self.assertEqual(strptime("UTC", "%Z").tzinfo, None)
4245
4246 def test_strptime_errors(self):
4247 for tzstr in ("-2400", "-000", "z", "24:00"):
4248 with self.assertRaises(ValueError):
4249 self.theclass.strptime(tzstr, "%z")
4250 with self.assertRaises(ValueError):
4251 self.theclass.strptime(tzstr, "%:z")
4252
4253 def test_strptime_single_digit(self):
4254 # bpo-34903: Check that single digit times are allowed.

Callers

nothing calls this directly

Calls 2

assertRaisesMethod · 0.45
strptimeMethod · 0.45

Tested by

no test coverage detected