diff --git a/.gitignore b/.gitignore index 7e18dc2d5bb..1eb612389e0 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ MANIFEST .ipynb_checkpoints/ .vscode/ tmp-test-dir-with-unique-name/ +htmlcov build/ dist/ doc/_build diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 98c1ef166a5..9c0560beb47 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -303,7 +303,8 @@ Run the tests and calculate test coverage using: make test The coverage report will let you know which lines of code are touched by the tests. -**Strive to get 100% coverage for the lines you changed.** +If all the tests pass, you can view the coverage reports by opening `htmlcov/index.html` +in your browser. **Strive to get 100% coverage for the lines you changed.** It's OK if you can't or don't know how to test something. Leave a comment in the PR and we'll help you out. diff --git a/Makefile b/Makefile index d618ae51cb9..97e93bcfbda 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ test: @cd $(TESTDIR); python -c "import $(PROJECT); $(PROJECT).show_versions()" @echo "" cd $(TESTDIR); pytest $(PYTEST_ARGS) $(PROJECT) - cp $(TESTDIR)/.coverage* . + cp $(TESTDIR)/.coverage* . && coverage html rm -r $(TESTDIR) format: @@ -43,6 +43,6 @@ lint: clean: find . -name "*.pyc" -exec rm -v {} \; find . -name "*~" -exec rm -v {} \; - rm -rvf build dist MANIFEST *.egg-info __pycache__ .coverage .cache + rm -rvf build dist MANIFEST *.egg-info __pycache__ .coverage .cache htmlcov rm -rvf $(TESTDIR) rm -rvf baseline