Skip to content

Commit 7cd7c8c

Browse files
Add regression test for #6895 (#6898)
* Upgrade astroid to 2.11.6 Co-authored-by: Pierre Sassoulas <[email protected]>
1 parent d6fa341 commit 7cd7c8c

File tree

5 files changed

+17
-2
lines changed

5 files changed

+17
-2
lines changed

doc/whatsnew/2/2.14/full.rst

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ What's New in Pylint 2.14.2?
55
----------------------------
66
Release date: TBA
77

8+
9+
* Fixed a false positive for ``unused-variable`` when a function returns an
10+
``argparse.Namespace`` object.
11+
12+
Closes #6895
13+
814
* Avoided raising an identical ``undefined-loop-variable`` message twice on the same line.
915

1016
* Don't crash if ``lint.run._query_cpu()`` is run within a Kubernetes Pod, that has only

requirements_test_min.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
-e .[testutils,spelling]
22
# astroid dependency is also defined in setup.cfg
3-
astroid==2.11.5 # Pinned to a specific version for tests
3+
astroid==2.11.6 # Pinned to a specific version for tests
44
typing-extensions~=4.2
55
pytest~=7.1
66
pytest-benchmark~=3.4

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ install_requires =
4747
# Also upgrade requirements_test_min.txt if you are bumping astroid.
4848
# Pinned to dev of next minor update to allow editable installs,
4949
# see https://github.com/PyCQA/astroid/issues/1341
50-
astroid>=2.11.5,<=2.12.0-dev0
50+
astroid>=2.11.6,<=2.12.0-dev0
5151
isort>=4.2.5,<6
5252
mccabe>=0.6,<0.8
5353
tomli>=1.1.0;python_version<"3.11"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
"""Regression test for https://github.com/PyCQA/pylint/issues/6895"""
2+
# pylint: disable=missing-class-docstring,too-few-public-methods
3+
import argparse
4+
class Cls:
5+
def meth(self):
6+
"""Enable non-iterator-returned to produce the failure condition"""
7+
return argparse.Namespace(debug=True)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[Messages Control]
2+
enable=non-iterator-returned

0 commit comments

Comments
 (0)