Skip to content

Commit

Permalink
Let pytest-django find the project automatically
Browse files Browse the repository at this point in the history
Add manage.py, as it seems to be required to fix the discovery of tests
  • Loading branch information
browniebroke committed Jul 26, 2024
1 parent 8bbe7a6 commit 7412770
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions manage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env python

import os
import sys

if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tests.settings")

from django.core.management import execute_from_command_line

execute_from_command_line(sys.argv)
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool:pytest]
django_find_project = false
testpaths = tests
addopts = --cov django_hosts --cov-append --cov-report=xml --cov-report term-missing
DJANGO_SETTINGS_MODULE = tests.settings

Expand Down

0 comments on commit 7412770

Please # to comment.