Closed
Description
One may presume that pytest
so popular that it is used with Django projects as often as the built-in manage.py test
framework (usually including plugins, e.g. pytest-django
). However, the IS_RUNNING_TESTS
setting detects only the latter by default by looking for "test"
in sys.argv
.
Updating:
by:
"IS_RUNNING_TESTS": ("test" in sys.argv) or "PYTEST_VERSION" in os.environ,
NOTE: Using PYTEST_VERSION
variable is a recommended way for determining whether pytest
is running; see pytest-dev/pytest#9502 (comment).