django-constance
django-constance copied to clipboard
pytest fixture scope
https://github.com/jazzband/django-constance/blob/4e5573ed95c6c4fd2f566e9669f03d4640eb75e9/constance/test/pytest.py#L74
By default pytest fixture has scope="function", so it can not be used with any scope, as mentioned in docs.
@last-partizan unfortunately, the global fixture can have only one scope. So no way to make it universal for any scope.
Luckily, a user is still able to override the fixture in the project's conftest.py or any test file like
@pytest.fixture(scope='module')
def override_config(override_config): # give same name for the custom fixture
with override_config(API_URL="/awesome/url/"):
yield
So i think this issue is more about mentioning that in the documentation rather than fixing fixture.
Yes, it's about mentioning this in documentation.
Can anyone help us with it?