I have my tests divided in multiple files with share a helpers.py
with common functions to all tests. For example:
helpers.py
@pytest.fixture
def settings():
test_component_a.py
from helpers import settings
@pytest.fixture
def fixture_A(settings):
@pytest.fixture
def fixture_B(settings):
def test_A(fixture_A):
def test_B(fixture_B):
I would like to know why in any definition of def fixture_X(settings)
I'm getting the "error" F811 - redefinition of unused 'settings' from line 1
.
The code is working without any issues, but as I'm getting that error, I guess I'm misusing something.
EDIT: my question is not similar to the one you say it's similar. In that question, the OP is clearly defining the same function at the same level. In my case, there is only one definition of the function (fixture) in helpers.py
. Then, the fixture is imported in another file, file which doesn't have any definition of the same function.