Skip to content

Fix copy-pasted assert messages in test_crossinterp - #161835

Open
andresdelfino wants to merge 1 commit into
python:mainfrom
andresdelfino:fix-test-crossinterp-assert-msg
Open

andresdelfino wants to merge 1 commit into
python:mainfrom
andresdelfino:fix-test-crossinterp-assert-msg

Conversation

@andresdelfino

Copy link
Copy Markdown
Contributor

In both test_module() methods (ShareableTypeTests and MarshalTests), the assertion for unittest reused the message from the line above it:

assert type(defs) is types.ModuleType, type(defs)
assert type(unittest) is types.ModuleType, type(defs)

So if unittest weren't a module, the failure would report the type of defs instead. This changes the message to type(unittest), matching the two lines before it.

Found while auditing test assertions for misused arguments (see #161774).

Test-only change, so this should be fine for skip issue / skip news. Tested locally on Linux; both test_module tests pass.

🤖 Generated with Claude Code

Both test_module() methods checked type(unittest) but reported
type(defs) on failure.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bedevere-app bedevere-app Bot added tests Tests in the Lib/test dir awaiting review labels Nov 11, 2026
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