Skip to content

Commit 2516c39

Browse files
author
beyondgeeks
committed
tests/conftest.py: move import of db_helpers (#737)
This is required for when conftests are loaded before Django gets setup (i.e. when it would be done in pytest_configure only). Not necessary, but easier to improve things from there.
1 parent 51de97a commit 2516c39

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
import six
77
from django.conf import settings
88

9-
from pytest_django_test.db_helpers import DB_NAME, TEST_DB_NAME
10-
119
try:
1210
import pathlib
1311
except ImportError:
@@ -40,6 +38,8 @@ def testdir(testdir, monkeypatch):
4038

4139
@pytest.fixture(scope="function")
4240
def django_testdir(request, testdir, monkeypatch):
41+
from pytest_django_test.db_helpers import DB_NAME, TEST_DB_NAME
42+
4343
marker = request.node.get_closest_marker("django_project")
4444

4545
options = _marker_apifun(**(marker.kwargs if marker else {}))

0 commit comments

Comments
 (0)