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 test for #6895 #6898

Merged
merged 3 commits into from
Jun 13, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions doc/whatsnew/2/2.14/full.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ What's New in Pylint 2.14.2?
----------------------------
Release date: TBA

* Fixed a false positive for ``unused-variable`` when a function returns an
``argparse.Namespace`` object.

Closes #6895


What's New in Pylint 2.14.1?
----------------------------
Expand Down
7 changes: 7 additions & 0 deletions tests/functional/u/unused/unused_variable_after_inference.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"""Regression test for https://github.com/PyCQA/pylint/issues/6895"""
# pylint: disable=missing-class-docstring,too-few-public-methods
import argparse
class Cls:
def meth(self):
"""Enable non-iterator-returned to produce the failure condition"""
return argparse.Namespace(debug=True)
2 changes: 2 additions & 0 deletions tests/functional/u/unused/unused_variable_after_inference.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[Messages Control]
enable=non-iterator-returned