Skip to content

Commit

Permalink
Add regression test for #6895 (#6898)
Browse files Browse the repository at this point in the history
* Upgrade astroid to 2.11.6

Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
  • Loading branch information
jacobtylerwalls and Pierre-Sassoulas committed Jun 13, 2022
1 parent b524db8 commit 258a5e9
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 2 deletions.
6 changes: 6 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,12 @@ 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

* Avoided raising an identical ``undefined-loop-variable`` message twice on the same line.

* Don't crash if ``lint.run._query_cpu()`` is run within a Kubernetes Pod, that has only
Expand Down
2 changes: 1 addition & 1 deletion requirements_test_min.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-e .[testutils,spelling]
# astroid dependency is also defined in setup.cfg
astroid==2.11.5 # Pinned to a specific version for tests
astroid==2.11.6 # Pinned to a specific version for tests
typing-extensions~=4.2
pytest~=7.1
pytest-benchmark~=3.4
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ install_requires =
# Also upgrade requirements_test_min.txt if you are bumping astroid.
# Pinned to dev of next minor update to allow editable installs,
# see https://github.com/PyCQA/astroid/issues/1341
astroid>=2.11.5,<=2.12.0-dev0
astroid>=2.11.6,<=2.12.0-dev0
isort>=4.2.5,<6
mccabe>=0.6,<0.8
tomli>=1.1.0;python_version<"3.11"
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

0 comments on commit 258a5e9

Please sign in to comment.