Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python: fix empty parametrize() leading to "NotSetType.token" id #7687

Merged
merged 1 commit into from Aug 25, 2020

Conversation

bluetech
Copy link
Member

Fixes #7686.

In ff8b788 NOTSET was changed to a singleton enum, which ended up unexpectedly triggering a code path in ID generation which checks for isinstance(Enum).

Add an explicit case for it, which is not too bad anyway.

In ff8b788 NOTSET was changed to a
singleton enum, which ended up unexpectedly triggering a code path in ID
generation which checks for `isinstance(Enum)`.

Add an explicit case for it, which is not too bad anyway.
@bluetech bluetech added the needs backport applied to PRs, indicates that it should be ported to the current bug-fix branch label Aug 25, 2020
Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @bluetech!

@nicoddemus nicoddemus merged commit 8730a7b into pytest-dev:master Aug 25, 2020
nicoddemus added a commit to nicoddemus/pytest that referenced this pull request Aug 25, 2020
python: fix empty parametrize() leading to "NotSetType.token" id
nicoddemus added a commit to nicoddemus/pytest that referenced this pull request Aug 25, 2020
python: fix empty parametrize() leading to "NotSetType.token" id
@nicoddemus
Copy link
Member

Backport: #7688

@nicoddemus nicoddemus added backported PR has been backported to the current bug-fix branch and removed needs backport applied to PRs, indicates that it should be ported to the current bug-fix branch labels Aug 26, 2020
@bluetech bluetech deleted the idval-notset branch August 27, 2020 06:59
alexharv074 added a commit to alexharv074/pytest that referenced this pull request Sep 19, 2021
In pytest-dev#7687 a bugfix was added
after NOTSET was changed to a singleton enum, which ended up breaking
ID generation when it checked for isinstance(Enum).

That change, however, did not update the code path in the same ID
generation when used as an idfn function.

This adjusts the logic to handle both cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported PR has been backported to the current bug-fix branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cosmetic issue while naming a test using pytest 6.0.1 compared to previous versions
2 participants