Skip to content

Commit

Permalink
improve coverage configuration
Browse files Browse the repository at this point in the history
Use dedicated directory - `.tests_reports/` - for all tests reports,
including `coverage` html, xml and json reports.
Update `coverage` configuration to:

+ measure `branch` coverage, refer to documentation:
  https://coverage.readthedocs.io/en/coverage-5.0.4/branch.html
+ show only not covered files and lines
+ sort report's results by coverage value
  • Loading branch information
skarzi committed Apr 1, 2020
1 parent c73ea4d commit 686d03a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,4 @@ fabric.properties
### Custom ###
ex.py
*.sqlite3
.tests_reports/
Empty file added .tests_reports/.gitkeep
Empty file.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ script:

after_success:
- pip install coveralls
- coveralls
- coveralls --rcfile=setup.cfg

notifications:
email:
Expand Down
16 changes: 16 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,25 @@ addopts =
# Why do we exclude this file from coverage?
# Because coverage is not calculated correctly for pytest plugins.
# And we completely test it anyway.
branch = True
data_file = .tests_reports/.coverage
omit =
django_test_migrations/contrib/pytest_plugin.py

[coverage:report]
skip_covered = True
show_missing = True
sort = Cover

[coverage:xml]
output = .tests_reports/coverage.xml

[coverage:json]
output = .tests_reports/coverage.json

[coverage:html]
directory = .tests_reports/htmlcov


[mypy]
# mypy configurations: http://bit.ly/2zEl9WI
Expand Down

0 comments on commit 686d03a

Please sign in to comment.