Skip to content

Commit 707ea08

Browse files
committed
refactor test %T as requested; rename %F + %T tests to match datetimetester request
1 parent 88c6f02 commit 707ea08

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

Lib/test/test_strptime.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -649,20 +649,19 @@ def test_mar1_comes_after_feb29_even_when_omitting_the_year(self):
649649
time.strptime("Feb 29", "%b %d"),
650650
time.strptime("Mar 1", "%b %d"))
651651

652-
def test_shorthand_year_month_day(self):
652+
def test_strptime_F_format(self):
653653
test_date = "2025-10-26"
654654
self.assertEqual(
655655
time.strptime(test_date,"%F"),
656656
time.strptime(test_date,"%Y-%m-%d")
657657
)
658658

659-
def test_shorthand_hour_minute_second(self):
660-
# Test that token '%T' is equivalent to '%H:%M:%S'
661-
formats = dict(short="%T",long="%H:%M:%S")
659+
def test_strptime_T_format(self):
662660
test_time = "15:00:00"
663-
shorthand = time.strptime(test_time,formats["short"])
664-
long_hand = time.strptime(test_time,formats["long"])
665-
self.assertEqual(shorthand,long_hand)
661+
self.assertEqual(
662+
time.strptime(test_time,"%T"),
663+
time.strptime(test_time,"%H:%M:%S")
664+
)
666665

667666
class Strptime12AMPMTests(unittest.TestCase):
668667
"""Test a _strptime regression in '%I %p' at 12 noon (12 PM)"""

0 commit comments

Comments
 (0)