-
Notifications
You must be signed in to change notification settings - Fork 346
Open
Description
I have a situation where I need to load huge db fixture which is created by a function. The fixture is needed in all api tests. So I made a session fixture at conftest.py
which would do it. But the problem is pytest
throws following exception even though I have marked django_db
:
E Failed: Database access not allowed, use the "django_db" mark to enable it.
Below is my code snippet.
from permission.helpers import update_permissions
pytestmark = [
pytest.mark.django_db(transaction = True),]
@pytest.fixture(scope="session", autouse = True)
def permission(request):
load_time_consuming_db_fixture()
MRigal, alexey-sveshnikov, stevanmilic, laysakura, lucas-bremond and 36 more