From 5fcb64613161eca4a7f77eaacbd19e5aa99e03c6 Mon Sep 17 00:00:00 2001 From: Rob McMullen Date: Sun, 7 May 2017 09:18:37 -0700 Subject: [PATCH] Added automatic pytest coverage annotated HTML report * added automatic coverage branch warnings and ignorable statements --- test/.coveragerc | 20 ++++++++++++++++++++ test/pytest.ini | 2 ++ 2 files changed, 22 insertions(+) create mode 100644 test/.coveragerc create mode 100644 test/pytest.ini diff --git a/test/.coveragerc b/test/.coveragerc new file mode 100644 index 0000000..ee74040 --- /dev/null +++ b/test/.coveragerc @@ -0,0 +1,20 @@ +[run] +branch = True + +[report] +# Regexes for lines to exclude from consideration +exclude_lines = + # Have to re-enable the standard pragma + pragma: no cover + + # Don't complain about missing debug-only code: + def __repr__ + if self\.debug + + # Don't complain if tests don't hit defensive assertion code: + raise AssertionError + raise NotImplementedError + + # Don't complain if non-runnable code isn't run: + if 0: + if __name__ == .__main__.: diff --git a/test/pytest.ini b/test/pytest.ini new file mode 100644 index 0000000..ebfb2cc --- /dev/null +++ b/test/pytest.ini @@ -0,0 +1,2 @@ +[pytest] +addopts = --cov=atrcopy --cov-report html --cov-report term