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

Method test_strptime_leap_year

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

Source from the content-addressed store, hash-verified

1203
1204 @warnings_helper.ignore_warnings(category=DeprecationWarning)
1205 def test_strptime_leap_year(self):
1206 # GH-70647: warns if parsing a format with a day and no year.
1207 with self.assertRaises(ValueError):
1208 # The existing behavior that GH-70647 seeks to change.
1209 date.strptime('02-29', '%m-%d')
1210 with self._assertNotWarns(DeprecationWarning):
1211 date.strptime('20-03-14', '%y-%m-%d')
1212 date.strptime('02-29,2024', '%m-%d,%Y')
1213
1214class SubclassDate(date):
1215 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