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

Method test_strptime_leap_year

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

Source from the content-addressed store, hash-verified

1208
1209 @warnings_helper.ignore_warnings(category=DeprecationWarning)
1210 def test_strptime_leap_year(self):
1211 # GH-70647: warns if parsing a format with a day and no year.
1212 with self.assertRaises(ValueError):
1213 # The existing behavior that GH-70647 seeks to change.
1214 date.strptime('02-29', '%m-%d')
1215 with self._assertNotWarns(DeprecationWarning):
1216 date.strptime('20-03-14', '%y-%m-%d')
1217 date.strptime('02-29,2024', '%m-%d,%Y')
1218
1219class SubclassDate(date):
1220 sub_var = 1

Callers

nothing calls this directly

Calls 3

_assertNotWarnsMethod · 0.80
assertRaisesMethod · 0.45
strptimeMethod · 0.45

Tested by

no test coverage detected