When using pytest fixtures, you are supposed to just declare them as input arguments, and they will be automagically loaded. For example:
import pytest
from myapp import meaning_of_life
@pytest.fixture
def foo():
return 42
def test_meaning_of_life(foo):
meaning = meaning_of_life()
assert meaning == foo
This will violate rule 442, which is not desired in this case.
One could argue that fixtures should live on a different file than tests, but you run on the same issue if you have fixtures dependent on other fixtures:
import pytest
@pytest.fixture
def foo():
return 42
@pytest.fixture
def bar(foo):
return foo + 1
I think we need to make this feature "pytest aware", or just document that it there is conflict with it and might need to be disabled.
When using pytest fixtures, you are supposed to just declare them as input arguments, and they will be automagically loaded. For example:
This will violate rule 442, which is not desired in this case.
One could argue that fixtures should live on a different file than tests, but you run on the same issue if you have fixtures dependent on other fixtures:
I think we need to make this feature "pytest aware", or just document that it there is conflict with it and might need to be disabled.