Skip to content

Fix missing comma in test_time tzname assertion - #161832

Open
andresdelfino wants to merge 1 commit into
python:mainfrom
andresdelfino:fix-test-time-tzname
Open

andresdelfino wants to merge 1 commit 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant