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

Method test_strftime_invalid_format

Lib/test/test_time.py:235–244  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

233 self.assertRaises(TypeError, time.strftime, b'%S', tt)
234
235 def test_strftime_invalid_format(self):
236 tt = time.gmtime(self.t)
237 with SuppressCrashReport():
238 for i in range(1, 128):
239 format = ' %' + chr(i)
240 with self.subTest(format=format):
241 try:
242 time.strftime(format, tt)
243 except ValueError as exc:
244 self.assertEqual(str(exc), 'Invalid format string')
245
246 def test_strftime_special(self):
247 tt = time.gmtime(self.t)

Callers

nothing calls this directly

Calls 5

SuppressCrashReportClass · 0.90
strFunction · 0.85
subTestMethod · 0.45
strftimeMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected