Skip to content

Commit ffbc215

Browse files
authored
Tests moved to datetimetester.py
1 parent e77ff96 commit ffbc215

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Lib/test/datetimetester.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1212,6 +1212,20 @@ def test_strptime_leap_year(self):
12121212
date.strptime('20-03-14', '%y-%m-%d')
12131213
date.strptime('02-29,2024', '%m-%d,%Y')
12141214

1215+
def test_strptime_C99_shorthand_year_month_day(self):
1216+
formats = dict(short="%F",long="%Y-%m-%d")
1217+
test_date = "2025-10-26"
1218+
shorthand = datetime.strptime(test_date,formats["short"])
1219+
long_hand = datetime.strptime(test_date,formats["long"])
1220+
self.assertEqual(shorthand,long_hand)
1221+
1222+
def test_strptime_C99_shorthand_hour_minute_second(self):
1223+
formats = dict(short="%T",long="%H:%M:%S")
1224+
test_time = "15:00:00"
1225+
shorthand = datetime.strptime(test_time,formats["short"])
1226+
long_hand = datetime.strptime(test_time,formats["long"])
1227+
self.assertEqual(shorthand,long_hand)
1228+
12151229
class SubclassDate(date):
12161230
sub_var = 1
12171231

0 commit comments

Comments
 (0)