Skip to content

Commit ab9d41a

Browse files
committed
replace vars with literals, as requested
1 parent bbe7d2e commit ab9d41a

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

Lib/test/datetimetester.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2208,17 +2208,16 @@ def test_strptime_D_format(self):
22082208
)
22092209

22102210
def test_strptime_n_and_t_format(self):
2211-
year, month, day = 2026, 2, 20
22122211
whitespaces = ('', ' ', '\t', '\r', '\v', '\n', '\f')
22132212
for fd in ('n', 't'):
22142213
for ws in (*whitespaces, ''.join(whitespaces)):
22152214
with self.subTest(format_directive=fd, whitespace=ws):
22162215
self.assertEqual(
22172216
self.theclass.strptime(
2218-
f"{year:04d}{ws}{month:02d}{ws}{day:02d}",
2217+
f"2026{ws}02{ws}01",
22192218
f"%Y%{fd}%m%{fd}%d"
22202219
),
2221-
self.theclass(year, month, day)
2220+
self.theclass(2026, 2, 1)
22222221
)
22232222

22242223
#############################################################################

Lib/test/test_strptime.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -671,18 +671,17 @@ def test_strptime_D_format(self):
671671
)
672672

673673
def test_strptime_n_and_t_format(self):
674-
year, month, day = 2026, 2, 20
675674
whitespaces = ('', ' ', '\t', '\r', '\v', '\n', '\f')
676675
for fd in ('n', 't'):
677676
for ws in (*whitespaces, ''.join(whitespaces)):
678677
with self.subTest(format_directive=fd, whitespace=ws):
679678
self.assertEqual(
680679
time.strptime(
681-
f"{year:04d}{ws}{month:02d}{ws}{day:02d}",
680+
f"2026{ws}02{ws}01",
682681
f"%Y%{fd}%m%{fd}%d"
683682
),
684683
time.strptime(
685-
f'{year:04d}-{month:02d}-{day:02d}',
684+
f'2026-02-01',
686685
"%Y-%m-%d"
687686
)
688687
)

0 commit comments

Comments
 (0)