From e20f5119c2a4eaac6e4eef743a67937404bab69e Mon Sep 17 00:00:00 2001 From: Flukx Date: Wed, 9 Dec 2020 13:36:29 +0000 Subject: [PATCH] introduce test coverage calculation --- README.md | 4 ++++ environment.yml | 1 + 2 files changed, 5 insertions(+) diff --git a/README.md b/README.md index c3a534b..0d68ad2 100644 --- a/README.md +++ b/README.md @@ -122,6 +122,10 @@ This is done via `pip install --editable .` in the environment file. Otherwise the source is not in the pythonpath and the tests cannot import it. It uses the `setup.py` with the `setup.cfg` config. The tests are run with `pytest` in the main directory. +Test coverage can be calculated with the +[coverage](https://coverage.readthedocs.io) module: +`coverage run --source=src -m pytest` +and shown with `coverage report` or `coverage html` afterwards. To create the documentation go to the `docs` directory: `cd docs` and run `make html`. Then under `docs/_build/html/index.html` you can view the created documentation. diff --git a/environment.yml b/environment.yml index 6e29fb8..9f1b3db 100644 --- a/environment.yml +++ b/environment.yml @@ -14,6 +14,7 @@ dependencies: - sphinx - SQLAlchemy-Utils>=0.31 - SQLAlchemy>=1.0 + - coverage - pip # packages to be installed via pip: - pip: