Skip to content

fix(mark): handle non-tuple non-list values in ParameterSet.extract_from - #14795

Closed
amir-rezaei wants to merge 2 commits into
pytest-dev:mainfrom
amir-rezaei:fix/parametrize-non-tuple-parameterset-extract
Closed

fix(mark): handle non-tuple non-list values in ParameterSet.extract_from#14795
amir-rezaei wants to merge 2 commits into
pytest-dev:mainfrom
amir-rezaei:fix/parametrize-non-tuple-parameterset-extract

Conversation

@amir-rezaei

Copy link
Copy Markdown

Description

This PR resolves issue #14619 by wrapping non-tuple and non-list items in a 1-tuple in ParameterSet.extract_from() in src/_pytest/mark/structures.py.

Details

  • Prevents TypeError: object of type 'NoneType' has no len() when None or single non-tuple values are passed to parametrize with trailing-comma parameter names (e.g. @pytest.mark.parametrize("x,", [None, ...])).

@psf-chronographer psf-chronographer Bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Jul 28, 2026
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.

3 participants