From 6f98bdb8b6be0b90807db5ee737ef0524d606826 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Thu, 21 Nov 2013 09:45:14 +0100 Subject: [PATCH] make a .coveragerc, move config there, some no cover declarations / exclude some code --- .coveragerc | 30 ++++++++++++++++++++++++++++++ .travis.yml | 3 +-- nsupdate/__init__.py | 2 +- 3 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..159a3dd --- /dev/null +++ b/.coveragerc @@ -0,0 +1,30 @@ +# .coveragerc to control coverage.py + +[run] +branch = True +source = nsupdate +omit = + */migrations/* + */_tests/* + nsupdate/wsgi.py + +[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__.: + +ignore_errors = True + diff --git a/.travis.yml b/.travis.yml index 56bc46f..bacbc42 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,9 +6,8 @@ install: - "pip install --upgrade --use-mirrors -e ." - "pip install coveralls" env: SECRET_KEY=justfortravis -script: "coverage run --source nsupdate --omit '*/migrations/*,*/_tests/*' -m py.test --pep8" +script: "coverage run -m py.test --pep8" after_success: - - coveralls debug - coveralls notifications: email: diff --git a/nsupdate/__init__.py b/nsupdate/__init__.py index e72625f..c3fd406 100644 --- a/nsupdate/__init__.py +++ b/nsupdate/__init__.py @@ -5,7 +5,7 @@ nsupdate - dynamic DNS service import re -class Version(tuple): +class Version(tuple): # pragma: no cover """ Version objects store versions like 1.2.3a4 in a structured way and support version comparisons and direct version component access.