From 23e4da4d66d32b92ad374ded905988b9fc5c3c40 Mon Sep 17 00:00:00 2001 From: Andrew Ferrier <andrewferrier@example.com> Date: Sat, 20 Dec 2014 16:13:46 +0000 Subject: [PATCH] Add code coverage checker - closes #43 --- .gitignore | 1 + Makefile | 5 +++++ README.md | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/.gitignore b/.gitignore index 75d4c73..1cc3b04 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *.deb +cover/ # Byte-compiled / optimized / DLL files __pycache__/ diff --git a/Makefile b/Makefile index a10721d..9be8c00 100644 --- a/Makefile +++ b/Makefile @@ -31,6 +31,11 @@ unittest_test: stylecheck: flake8 --max-line-length=132 . +coverage: + rm -r cover/ + nosetests tests/test_Direct.py --with-coverage --cover-package=email2pdf --cover-erase --cover-html + open cover/email2pdf.html + clean: rm -f *.deb rm -f *.log diff --git a/README.md b/README.md index 5aac3a7..0e1823c 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,11 @@ All the unit tests are in the `tests/` directory. You can run them from the Makefile using the `unittest` or `unittest_test` targets (the second is more verbose, and stops on failing tests). +### Code Coverage + +There is a code coverage target in the Makefile. You'll need to have the +`coverage` Python module installed (`pip3 install coverage`) to run it. + ### Debian * Install all the package dependencies listed in the