Skip to content

Commit

Permalink
Use pytest-cov plugin for coverage
Browse files Browse the repository at this point in the history
This handles the parallel/multithreaded tests better than regular
coverage, which excluded a lot of lines (due to parallelization/
combination of coverage reports before they were done?)
  • Loading branch information
amstilp committed May 7, 2024
1 parent 29d25cc commit a2aa962
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
run: python manage.py collectstatic --noinput --settings=config.settings.test

- name: Run tests
run: coverage run -p -m pytest -n auto
run: pytest --cov=primed -n auto

- name: Upload coverage data
uses: actions/upload-artifact@v4
Expand Down
2 changes: 2 additions & 0 deletions requirements/test-requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
pytest # https://github.com/pytest-dev/pytest
# Parallelized tests
pytest-xdist # https://github.com/pytest-dev/pytest-xdist
# Coverage integrated with pytest
pytest-cov
# Pytest improvements - progress bar, etc.
pytest-sugar # https://github.com/Frozenball/pytest-sugar
# Mock HTTP responses
Expand Down
2 changes: 2 additions & 0 deletions requirements/test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ pytest==8.2.0
# -r requirements/test-requirements.in
# pytest-django
# pytest-sugar
pytest-cov==5.0.0
# via -r requirements/test-requirements.in
pytest-django==4.8.0
# via -r requirements/test-requirements.in
pytest-sugar==1.0.0
Expand Down

0 comments on commit a2aa962

Please sign in to comment.