(self)
| 3121 | |
| 3122 | @warnings_helper.ignore_warnings(category=DeprecationWarning) |
| 3123 | def test_strptime_leap_year(self): |
| 3124 | # GH-70647: warns if parsing a format with a day and no year. |
| 3125 | with self.assertRaises(ValueError): |
| 3126 | # The existing behavior that GH-70647 seeks to change. |
| 3127 | self.theclass.strptime('02-29', '%m-%d') |
| 3128 | with self.assertWarnsRegex(DeprecationWarning, |
| 3129 | r'.*day of month without a year.*'): |
| 3130 | self.theclass.strptime('03-14.159265', '%m-%d.%f') |
| 3131 | with self._assertNotWarns(DeprecationWarning): |
| 3132 | self.theclass.strptime('20-03-14.159265', '%y-%m-%d.%f') |
| 3133 | with self._assertNotWarns(DeprecationWarning): |
| 3134 | self.theclass.strptime('02-29,2024', '%m-%d,%Y') |
| 3135 | |
| 3136 | def test_strptime_z_empty(self): |
| 3137 | for directive in ('z', ':z'): |
nothing calls this directly
no test coverage detected