Skip to content

Commit

Permalink
Ensure tests are actually run
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tari committed Jul 30, 2024
1 parent fba10f7 commit e8cda31
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,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 =
Expand Down Expand Up @@ -79,3 +79,4 @@ source = django_downloadview,demo
[pytest]
DJANGO_SETTINGS_MODULE = demoproject.settings
addopts = --doctest-modules --ignore=docs/
python_files = tests/*.py

0 comments on commit e8cda31

Please sign in to comment.