pytest.fixture() can be used either as
@pytest.fixture
def func(): ...
or as
@pytest.fixture()
def func(): ...
or (while maybe not intended)
func = pytest.fixture(func)
so it needs to inspect internally whether it got a function in the first
positional argument or not.
Previously, there were was oddity. In the following,
func = pytest.fixture(func, autouse=True)
# OR
func = pytest.fixture(func, parms=['a', 'b'])
The result is as if `func` wasn't passed.
There isn't any reason for this special that I can understand, so remove
it.
4 lines
209 B
ReStructuredText
4 lines
209 B
ReStructuredText
When using ``pytest.fixture`` on a function directly, as in ``pytest.fixture(func)``,
|
|
if the ``autouse`` or ``params`` arguments are also passed, the function is no longer
|
|
ignored, but is marked as a fixture.
|