This rule raises an issue when @pytest.fixture explicitly sets scope="function", which is already the default.
In Python, this refers to @pytest.fixture(scope="function"), which restates the default scope.
The default fixture scope is "function". Writing scope="function" explicitly does not change behavior and adds clutter.
Drop the argument and use @pytest.fixture alone unless you need a non-default value such as "class", "module",
"package", or "session":
import pytest
@pytest.fixture(scope="function") # Noncompliant
def default_scope():
return {}
import pytest
@pytest.fixture
def default_scope():
return {}
Redundant scope="function" distracts readers without changing fixture lifetime, which slows review of real scoping choices.