Skip to content

Suppressed Pylint Warnings not working when none of new warnings enabled #70

Open
@ppiasek

Description

@ppiasek

Describe the bug
I installed pylint-pytest plugin only to suppress pylint warnings related to pytest package usage. All introduced new warnings are disabled because other linters are checking them.

For some reason, the W0621 warning was constantly displayed on my test file, when the pytest fixture was defined and later used in the tests. After adding any newly introduced warnings to the config file, the W0621 warning stopped displaying.

To Reproduce
Package versions

  • pylint==3.1.0
  • pylint-pytest==1.1.8
  • pytest==8.1.1
  • pytest-cov==5.0.0
  • pytest-mock==3.14.0

Folder structure
Doesn't matter, just create a file with content below.

File content

import pytest


@pytest.fixture()
def my_fixture():
    return


def test_fixture(my_fixture):
    pass

pylint output with the plugin

$ python -m pylint tests/example.py 
************* Module tests.example
tests\example.py:9:17: W0621: Redefining name 'my_fixture' from outer scope (line 5) (redefined-outer-name)

-----------------------------------
Your code has been rated at 8.00/10

Expected behavior
W0621 warning is suppressed by pylint-pytest plugin when fixture and tests using it are defined in the same file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions