-
-
Notifications
You must be signed in to change notification settings - Fork 276
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
Fix relative-beyond-top-level
false positive
#1186
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to add a test in astroid too. Maybe we can use the same one than in pylint ?
@Pierre-Sassoulas Would you mind taking a look at this? I have added the necessary files to create the same test as in |
There's no handy automated functional tests like in pylint :) I think you have to parse them manually, there's probably example of reading data in the testdata directory Maybe we could imagine adding some helper like in pylint but we'd have to create a text representation of the expected AST (?) This would be helpful but probably quite a lot of work too. |
I used a unittest in |
@hippo91 how do you handle test using real file in |
@Pierre-Sassoulas @DanielNoord i never had to use |
24d6d28
to
8b04eb0
Compare
for more information, see https://pre-commit.ci
Sorry for the rebase. I have added a test based on some of the others I saw using the |
This PR sees to cause a regression with the |
Opened #1200 with an example to reproduce the error. |
Steps
Description
I believe this solves the false positive as discussed in the
pylint
issue. However, I'm not 100% comfortable with namespace packages so please tell me if I did anything wrong here.I have not added a test yet, but I have openend a
pylint
PR which includes a test that does pass.See: pylint-dev/pylint#5059
Type of Changes
Related Issue
pylint-dev/pylint#2967