You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@pytest.fixture()defasync_wrapper():
"""Fixture to convert all regular functions into async ones."""deffactory(template: str) ->str:
returntemplate.replace(
'def ', 'async def ',
).replace(
'with ', 'async with ',
).replace(
'for ', 'async for ',
)
returnfactory@pytest.fixture()defregular_wrapper():
"""Fixture to return regular functions without modifications."""deffactory(template: str) ->str:
returntemplatereturnfactory@pytest.fixture(params=['async_wrapper', 'regular_wrapper'])defmode(request):
"""Fixture that returns either `async` or regular functions."""returnrequest.getfixturevalue(request.param)
And pytest --dead-fixtures marks both of them as unused:
» pytest --dead-fixtures --dup-fixtures
Hey there, I believe the following fixture(s) are not being used:
Fixture name: async_wrapper, location: tests/test_visitors/conftest.py:65
Fixture name: regular_wrapper, location: tests/test_visitors/conftest.py:79
I am using this approach in some of my fixtures:
And
pytest --dead-fixtures
marks both of them as unused:What can be done to suppress this error?
Source code: https://github.com/wemake-services/wemake-python-styleguide/blob/master/tests/test_visitors/conftest.py#L64-L89
Related: wemake-services/wemake-python-styleguide#1017
The text was updated successfully, but these errors were encountered: