Skip to content

Fix missing comma in test_time tzname assertion - #161832

Merged
StanFromIreland merged 3 commits into
python:mainfrom
andresdelfino:fix-test-time-tzname
Nov 15, 2026
Merged

StanFromIreland merged 3 commits into
python:mainfrom
andresdelfino:fix-test-time-tzname

Conversation

@andresdelfino

Copy link
Copy Markdown
Contributor

In test_tzset, ('AEST' 'EST') is implicit string concatenation rather than a tuple, so assertIn(time.tzname[0], ('AEST' 'EST')) was a substring check against 'AESTEST' and would also accept values such as 'ST' or 'TES'. Adding the missing comma makes it the intended membership check, matching the tzname[1] check on the next line.

Found while auditing test assertions for misused arguments.

Test-only change, so this should be fine for skip issue / skip news. Tested locally on Linux, where the Victoria timezone gives time.tzname == ('AEST', 'AEDT'); test_time passes.

🤖 Generated with Claude Code

('AEST' 'EST') is implicit string concatenation rather than a tuple, so
the assertIn() in test_tzset was a substring check against 'AESTEST'.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread Lib/test/test_time.py Resolved
Comment thread Lib/test/test_time.py Resolved
@StanFromIreland
StanFromIreland merged commit 15cbd9b into python:main Nov 15, 2026
59 checks passed
@StanFromIreland StanFromIreland added needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes labels Nov 15, 2026
@miss-islington-app

Copy link
Copy Markdown

Thanks @andresdelfino for the PR, and @StanFromIreland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Thanks @andresdelfino for the PR, and @StanFromIreland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Nov 15, 2026

Copy link
Copy Markdown

GH-162064 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Nov 15, 2026
@bedevere-app

bedevere-app Bot commented Nov 15, 2026

Copy link
Copy Markdown

GH-162065 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Nov 15, 2026
StanFromIreland added a commit that referenced this pull request Nov 15, 2026
(cherry picked from commit 15cbd9b)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
StanFromIreland added a commit that referenced this pull request Nov 15, 2026
(cherry picked from commit 15cbd9b)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip issue skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants