Skip to content

Commit a835c2e

Browse files
committed
Consider testpaths config when looking for manage.py
1 parent d4f42ea commit a835c2e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pytest_django/plugin.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,11 @@ def _handle_import_error(extra_message):
118118
raise ImportError(msg)
119119

120120

121-
def _add_django_project_to_path(args):
121+
def _add_django_project_to_path(early_config, args):
122122
args = [x for x in args if not str(x).startswith("-")]
123123

124124
if not args:
125-
args = [py.path.local()]
125+
args = early_config.getini('testpaths') + [py.path.local()]
126126

127127
for arg in args:
128128
arg = py.path.local(arg)
@@ -192,7 +192,7 @@ def pytest_load_initial_conftests(early_config, parser, args):
192192
early_config.getini('django_find_project'), 'django_find_project')
193193

194194
if django_find_project:
195-
_django_project_scan_outcome = _add_django_project_to_path(args)
195+
_django_project_scan_outcome = _add_django_project_to_path(early_config, args)
196196
else:
197197
_django_project_scan_outcome = PROJECT_SCAN_DISABLED
198198

0 commit comments

Comments
 (0)