-
Notifications
You must be signed in to change notification settings - Fork 8
Handle pytest failure #16
Comments
@iakum this is implemented and released with v1.1.0 Can you help to verify if it's working as expected on your end? |
Unfortunately this change has resulted in the following error whenever I lint
Running |
Thanks for reporting the issue @crown-bdee! Apparently pytest is not happy when I run the collection on
I just pushed a fix 5804967 can you help to test that out? If that works in your setup then I'll publish a hotfix release soon. |
That was quick! |
Also works fine for me. Thanks a lot! |
Looks like around 50% of our projects failed on their nightly builds with this warning - this time not on setup.py, but rather on (some of) the actual test files. |
@crown-bdee can you provide more info? More specifically the output from It could probably relate to how the folders/modules were structured. |
I have narrowed it down (in one project at least, haven't checked through others yet) to it producing the error if a module with in the package has either a Output of pylint command:
Output of collect:
Thanks for your work on this! |
Out of interest, @reverbc did that reproduce the error on your end? |
Thanks |
Feature request type
Is your feature request related to a problem? Please describe.
This plugin executes pytest in the background which obviously loads modules. If loading of a module fails for whatever reasons (e.g. init imports an non-existing type), pytest will fail. However, pylint-pytest just ignores the failure and continue as nothing happens. Since no fixtures could be collected, all previously suppressed errors will be shown.
Of course, the issue can be found with pylint, etc. But e.g. in my project I suppress >50 errors which makes it hard to find the root cause.
Describe the solution you'd like
I would be nice, if pylint-pytest could fail on an pytest error or at least shown an indicator. Maybe a configuration can help :-)
Sample code to demonstrate the current imperfect behavior
With the above code, no supression will happen, but you will not see, that this was caused by an issue.
The text was updated successfully, but these errors were encountered: