Open
Description
openedon May 17, 2024
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment