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
Crash when a test function is decorated with @pytest.fixture
#4612
Comments
Hello, sure. It look like an unhandled inference fail on astroid. Could you provide the code causing this exception, please ? (You can follow the template for a 'bug' issue) |
The problem is that it falls over for any of the modules and I cannot see what is causing it., for example of I had module A, B, C in this repo and it currently fails on A, if I then comment out A it fails on B and so on. Is there some way I can further debug because this has only just started happening and the last build against master was fine, I created a new PR against master with a readme only change and it still fails... The previous change was also not even a python code change but a terraform only change. |
I would need the traceback or the code it fails on to help you. It probably has something to do with a decorator, you could try isolating them. Maybe you can create a minimal sharable example that way. |
Here is the stack trace in the build logs:
|
Is there a decorator at |
The only decorator defined in that file is |
If I comment out everything but the first fixture in the test file it now moves on and fails on the next test file:
|
Is it possible to see line 92 previously or line 66 now ? |
Sure:
|
Thanks!! You have helped me to diagnose the issue, I have updated the PR to use a context manager for all calls to This might also help you diagnose the issue (if you still think there is one), for example the fixtures in the tests now look like:
I am currently replacing the calls which open the test resource files in fixtures in this feature branch and it seems to get further and further, I will feedback if this turns out to be a red herring but it certainly looks to be resolving the issue. |
And astroid can't infer the name of the decorator. Closes pylint-dev#4612
@pytest.fixture
The fix will be available in |
Awesome thanks, and thanks for maintaining such a useful tool! |
And astroid can't infer the name of the decorator when using ``open`` without ``with``. Closes pylint-dev#4612
Question
I am using pylint 2.8.3 and one of my repos pipeline fails for the following exception within pylint:
I cannot work out what is causing this but if I remove a failing module then this exception just gets thrown in another module.
Can anyone assist me with debugging this issue?
The text was updated successfully, but these errors were encountered: