-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
False positive R1732 consider-using-with #4430
Comments
I think it makes sense. @DudeNr33 do you want to handle this one ? |
Yes, I will take a look at it. |
Suppressing the message if the resource is allocated inside a context manager is finished. However I struggle a bit with the suggested warning that should trigger if the resource is not released in the
@Pierre-Sassoulas what is your opinion on this? Should we split this up in two separate tickets? Which checker should be responsible for emitting the warning? |
Yes let's get rid of the false positive first then we can make another issue for the non trivial check in |
Disable "consider-using-with" because there is no way we can avoid using "with" while assigning instance variable. Similar to pylint bug pylint-dev/pylint#4430 Also replace @pytest.yield_fixture with @pytest.fixture to avoid PytestDeprecationWarning
Disable "consider-using-with" because there is no way we can avoid using "with" while assigning instance variable. Similar to pylint bug pylint-dev/pylint#4430 Also replace @pytest.yield_fixture with @pytest.fixture to avoid PytestDeprecationWarning
Steps to reproduce
Given a file
a.py
:Current behavior
Result of
pylint a.py
:Expected behavior
When resources are allocated in a context manager's
__enter__
method, this warning should be suppressed.Instead, a warning should be issued if the resource is not released in the
__exit__
method.pylint --version output
Result of
pylint --version
output:The text was updated successfully, but these errors were encountered: