-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
C: undefined-variableIssues related to 'undefined-variable' checkIssues related to 'undefined-variable' checkC: used-before-assignmentIssues related to 'used-before-assignment' checkIssues related to 'used-before-assignment' checkDecoratorsFalse Positive 🦟A message is emitted but nothing is wrong with the codeA message is emitted but nothing is wrong with the codeNeeds PRThis issue is accepted, sufficiently specified and now needs an implementationThis issue is accepted, sufficiently specified and now needs an implementation
Description
Bug description
"""The following code should lint ok, but pylint issues undefined- / unused-variable l"""
import pytest
@pytest.mark.parametrize("x", l := [1, 2, 3])
@pytest.mark.parametrize("y", l)
def test_demo(x, y):
"""pylint demo"""
_ = [x, y]
Configuration
No response
Command used
pylint test_pylint.py
Pylint output
************* Module test.configdb.config_utils.test_pylint
test_pylint.py:6:30: E0602: Undefined variable 'l' (undefined-variable)
test_pylint.py:5:30: W0612: Unused variable 'l' (unused-variable)
Expected behavior
linting should be ok
Pylint version
$ pylint --version
pylint 3.2.0
astroid 3.2.1
Python 3.10.13 (main, Jan 12 2024, 16:58:07) [GCC 11.4.0]
OS / Environment
Ubuntu 22.04.4 LTS
Additional dependencies
pytest==7.1.1
Metadata
Metadata
Assignees
Labels
C: undefined-variableIssues related to 'undefined-variable' checkIssues related to 'undefined-variable' checkC: used-before-assignmentIssues related to 'used-before-assignment' checkIssues related to 'used-before-assignment' checkDecoratorsFalse Positive 🦟A message is emitted but nothing is wrong with the codeA message is emitted but nothing is wrong with the codeNeeds PRThis issue is accepted, sufficiently specified and now needs an implementationThis issue is accepted, sufficiently specified and now needs an implementation