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

Add regression tests for Enum.name and .value inference #4558

Merged
merged 4 commits into from
Jun 16, 2021

Conversation

nelfin
Copy link
Contributor

@nelfin nelfin commented Jun 10, 2021

Steps

  • Add yourself to CONTRIBUTORS if you are a new contributor.
  • Add a ChangeLog entry describing what your PR does.
  • If it's a new feature or an important bug fix, add a What's New entry in
    doc/whatsnew/<current release.rst>.
  • Write a good description on what the PR does.

Description

Captures the regression tests specified in #1932 and #2062 and fixed by pylint-dev/astroid#1020.

Type of Changes

Type
📜 Docs

Related Issue

Closes #1932. Closes #2062. Depends on pylint-dev/astroid#1020.

@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.9.0 milestone Jun 10, 2021
@cdce8p cdce8p added the Needs astroid update Needs an astroid update (probably a release too) before being mergable label Jun 13, 2021
@cdce8p
Copy link
Member

cdce8p commented Jun 13, 2021

@nelfin Feel free to add Closes #... to the PR description. Otherwise the issues will stay open, probably forever.
Could you add a small note to the ChangeLog? I imagine not many will read the one for astroid.

Lastly, I saw by accident that #2306 appears to be fixed as well, at least for Python < 3.10. Something changed of for 3.10 though.

@nelfin
Copy link
Contributor Author

nelfin commented Jun 13, 2021

@nelfin Feel free to add Closes #... to the PR description. Otherwise the issues will stay open, probably forever.

This PR doesn't actually fix those issues though?

Could you add a small note to the ChangeLog? I imagine not many will read the one for astroid.

Sure.

Lastly, I saw by accident that #2306 appears to be fixed as well, at least for Python < 3.10. Something changed of for 3.10 though.

The implementation of enum.Enum changed in 3.10 away from just a plain DynamicClassAttribute. I guess I can take a look at what it takes to get that test to pass.

@nelfin nelfin force-pushed the fix/1932+2062-enum-name-member branch from e50b5bb to 685f410 Compare June 13, 2021 21:33
@cdce8p
Copy link
Member

cdce8p commented Jun 13, 2021

@nelfin Feel free to add Closes #... to the PR description. Otherwise the issues will stay open, probably forever.

This PR doesn't actually fix those issues though?

I thought it did. If you meant that pylint-dev/astroid#1020 actually fixed it, that is no problem. I frequently use Closes ... only for the last PR in pylint. As long as they are related.

Could you add a small note to the ChangeLog? I imagine not many will read the one for astroid.

Sure.

Lastly, I saw by accident that #2306 appears to be fixed as well, at least for Python < 3.10. Something changed of for 3.10 though.

The implementation of enum.Enum changed in 3.10 away from just a plain DynamicClassAttribute. I guess I can take a look at what it takes to get that test to pass.

Thanks 👍🏻

@nelfin
Copy link
Contributor Author

nelfin commented Jun 13, 2021

I thought it did. If you meant that PyCQA/astroid#1020 actually fixed it, that is no problem.

That is what I meant. I've updated the description.

Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

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

👍

@cdce8p
Copy link
Member

cdce8p commented Jun 14, 2021

@nelfin Thanks for fixing the issue with 3.10! Would you mind adding the regression test for it here? Just so we don't lose it

@nelfin
Copy link
Contributor Author

nelfin commented Jun 15, 2021

@cdce8p, do you mean this regression test: #4570? I opened that one when I pushed up the fix, but I can squash that PR into this one if that's your preference.

@cdce8p
Copy link
Member

cdce8p commented Jun 15, 2021

@cdce8p, do you mean this regression test: #4570? I opened that one when I pushed up the fix, but I can squash that PR into this one if that's your preference.

That works as well! Didn't saw it before.

@coveralls
Copy link

coveralls commented Jun 16, 2021

Coverage Status

Coverage remained the same at 92.037% when pulling c60fddd on nelfin:fix/1932+2062-enum-name-member into e3010e6 on PyCQA:master.

@cdce8p cdce8p merged commit f3ea315 into pylint-dev:master Jun 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🪲 Needs astroid update Needs an astroid update (probably a release too) before being mergable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enum: Method 'name' has no 'lower' member (no-member) pylint has issues with IntEnum.name type detection
4 participants