Skip to content

Raise TypeError again for non-marks in pytest.param(marks=...) - #15351

Open
aidxhxr wants to merge 1 commit into
pytest-dev:mainfrom
aidxhxr:param-non-mark-marks
Open

aidxhxr wants to merge 1 commit into
pytest-dev:mainfrom
aidxhxr:param-non-mark-marks

Conversation

@aidxhxr

@aidxhxr aidxhxr commented Nov 8, 2026

Copy link
Copy Markdown

Closes #15350.

Since #12828, pytest.param checks for usefixtures by reading .name on each mark before the marks are validated, so a non-mark such as marks=["x"] raises AttributeError: 'str' object has no attribute 'name'. The check now goes through normalize_mark_list, which raises TypeError: got 'x' instead of Mark like 8.3 did. usefixtures marks still raise the existing ValueError.

Added a test next to test_param_rejects_usefixtures, a changelog entry, and myself to AUTHORS.

AI-assisted (Claude Code, credited in the commit trailer); I reviewed the change and understand it.

Since pytest-dev#12828, `pytest.param(marks=...)` reads `.name` on each mark before
they are validated, so a non-mark raises `AttributeError` instead of the
`TypeError` from `normalize_mark_list`.

Closes pytest-dev#15350

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pyba-chronographer pyba-chronographer Bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Nov 8, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided (automation) changelog entry is part of PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pytest.param raises AttributeError for a non-mark in marks (regression in 8.4)

1 participant