Skip to content

Commit 029ed4f

Browse files
committed
refactor test for %F as requested
1 parent 0a928e6 commit 029ed4f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Lib/test/test_strptime.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -650,11 +650,11 @@ def test_mar1_comes_after_feb29_even_when_omitting_the_year(self):
650650
time.strptime("Mar 1", "%b %d"))
651651

652652
def test_shorthand_year_month_day(self):
653-
formats = dict(short="%F",long="%Y-%m-%d")
654653
test_date = "2025-10-26"
655-
shorthand = time.strptime(test_date,formats["short"])
656-
long_hand = time.strptime(test_date,formats["long"])
657-
self.assertEqual(shorthand,long_hand)
654+
self.assertEqual(
655+
time.strptime(test_date,"%F"),
656+
time.strptime(test_date,"%Y-%m-%d")
657+
)
658658

659659
def test_shorthand_hour_minute_second(self):
660660
# Test that token '%T' is equivalent to '%H:%M:%S'

0 commit comments

Comments
 (0)