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

Refactor change in PR#7687 #9104

Conversation

alexharv074
Copy link

In #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.

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.
@alexharv074
Copy link
Author

This PR is raised for discussion as much as a request to merge. As a full disclosure, I did not fully understand what this code I edited is doing, and exactly the nature of the bug I am fixing. Rather, I made an educated guess after seeing what was happening inside the debugger.

@nicoddemus
Copy link
Member

nicoddemus commented Sep 22, 2021

Hi @alexharv074,

Thanks for the PR.

Can you explain why the new code is better? They seem equivalent to me, with the exception that yours has a bit of extra duplication (the return str(argname) + str(idx) line).

@bluetech
Copy link
Member

@alexharv074 I think a regression test (fails before your change, passes after) would help, both in understanding the issue and in making sure it won't repeat again.

@Zac-HD
Copy link
Member

Zac-HD commented Jun 20, 2023

Closing this PR as it's been inactive for almost two years.

@Zac-HD Zac-HD closed this Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants