@@ -1206,14 +1206,18 @@ def test_strptime_single_digit(self):
12061206 newdate = strptime (string , format )
12071207 self .assertEqual (newdate , target , msg = reason )
12081208
1209- @warnings_helper .ignore_warnings (category = DeprecationWarning )
12101209 def test_strptime_leap_year (self ):
1211- # GH-70647: warns if parsing a format with a day and no year.
1210+ # GH-70647: %d errors if parsing a format with a day and no year.
12121211 with self .assertRaises (ValueError ):
12131212 # The existing behavior that GH-70647 seeks to change.
12141213 date .strptime ('02-29' , '%m-%d' )
12151214 with self .assertRaises (ValueError ):
12161215 date .strptime ('02-29' , '%m-%e' )
1216+ # %e without a year is deprecated, scheduled for removal in 3.17.
1217+ _strptime ._regex_cache .clear ()
1218+ with self .assertWarnsRegex (DeprecationWarning ,
1219+ r'.*day of month without a year.*' ):
1220+ date .strptime ('02- 1' , '%m-%e' )
12171221 with self ._assertNotWarns (DeprecationWarning ):
12181222 date .strptime ('20-03-14' , '%y-%m-%d' )
12191223 date .strptime ('02-29,2024' , '%m-%d,%Y' )
@@ -3122,15 +3126,15 @@ def test_strptime_single_digit(self):
31223126 newdate = strptime (string , format )
31233127 self .assertEqual (newdate , target , msg = reason )
31243128
3125- @warnings_helper .ignore_warnings (category = DeprecationWarning )
31263129 def test_strptime_leap_year (self ):
3127- # GH-70647: warns if parsing a format with a day and no year.
3130+ # GH-70647: %d errors if parsing a format with a day and no year.
31283131 with self .assertRaises (ValueError ):
31293132 # The existing behavior that GH-70647 seeks to change.
31303133 self .theclass .strptime ('02-29' , '%m-%d' )
3131- with self .assertWarnsRegex (DeprecationWarning ,
3132- r'.*day of month without a year.*' ):
3134+ with self .assertRaises (ValueError ):
31333135 self .theclass .strptime ('03-14.159265' , '%m-%d.%f' )
3136+ # %e without a year is deprecated, scheduled for removal in 3.17.
3137+ _strptime ._regex_cache .clear ()
31343138 with self .assertWarnsRegex (DeprecationWarning ,
31353139 r'.*day of month without a year.*' ):
31363140 self .theclass .strptime ('03-14.159265' , '%m-%e.%f' )
0 commit comments