From e2b4470c5b624d7908fdb197df7e0c7749b8f007 Mon Sep 17 00:00:00 2001 From: Peter Marheine Date: Tue, 30 Jul 2024 11:46:17 +0000 Subject: [PATCH] Ensure tests are actually run pytest by default only discovers tests in files named test_*.py, so none of the tests were actually being executed. Set the appropriate pytest option to discover the tests so they are automatically run. --- tox.ini | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index 612cd5d..d8e4eb3 100644 --- a/tox.ini +++ b/tox.ini @@ -31,10 +31,10 @@ deps = commands = pip install -e . pip install -e demo - # doctests + # doctests and unit tests pytest --cov=django_downloadview --cov=demoproject {posargs} - # all other test cases - coverage run --append {envbindir}/demo test {posargs: tests demoproject} + # demo project integration tests + coverage run --append {envbindir}/demo test {posargs: demoproject} coverage xml pip freeze ignore_outcome = @@ -76,3 +76,4 @@ source = django_downloadview,demo [pytest] DJANGO_SETTINGS_MODULE = demoproject.settings addopts = --doctest-modules --ignore=docs/ +python_files = tests/*.py