-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
I am using this approach in some of my fixtures:
@pytest.fixture()
def async_wrapper():
"""Fixture to convert all regular functions into async ones."""
def factory(template: str) -> str:
return template.replace(
'def ', 'async def ',
).replace(
'with ', 'async with ',
).replace(
'for ', 'async for ',
)
return factory
@pytest.fixture()
def regular_wrapper():
"""Fixture to return regular functions without modifications."""
def factory(template: str) -> str:
return template
return factory
@pytest.fixture(params=['async_wrapper', 'regular_wrapper'])
def mode(request):
"""Fixture that returns either `async` or regular functions."""
return request.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:79What 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
Metadata
Metadata
Assignees
Labels
No labels