diff options
author | Lars Wirzenius <liw@iki.fi> | 2008-05-18 16:42:30 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@iki.fi> | 2008-05-18 16:42:30 +0300 |
commit | ed17057e15518b87fcb27ef40367496b844a14bf (patch) | |
tree | e540a3f3b54f82bd3b8fde4b2a756443afac2cc5 | |
parent | 120cf2d9ccc371919507a2759e2f1f4aa00e6b25 (diff) | |
parent | e724978b90f5060e7aebb6be271b40f10e643514 (diff) | |
download | python-coverage-test-runner-ed17057e15518b87fcb27ef40367496b844a14bf.tar.gz |
New upstream version.
-rw-r--r-- | CoverageTestRunner.py | 1 | ||||
-rw-r--r-- | NEWS | 7 | ||||
-rw-r--r-- | README | 19 | ||||
-rw-r--r-- | debian/changelog | 6 | ||||
-rw-r--r-- | setup.py | 2 |
5 files changed, 34 insertions, 1 deletions
diff --git a/CoverageTestRunner.py b/CoverageTestRunner.py index 77da379..7a6370a 100644 --- a/CoverageTestRunner.py +++ b/CoverageTestRunner.py @@ -134,6 +134,7 @@ class CoverageTestRunner: for module, test_module, suite in module_pairs: coverage.erase() + coverage.exclude("#\s*pragma: no cover") coverage.start() sys.path.insert(0, os.path.dirname(module.__file__)) reload(module) @@ -0,0 +1,7 @@ +NEWS about CoverageTestRunner +============================= + +Version 1.1, released 2008-05-18 +-------------------------------- + +Added support for '#pragma: no cover'. @@ -87,6 +87,25 @@ executed during the tests, a list of files and statement numbers is included in the output. +Excluding some statements from the coverage analysis +==================================================== + +Use "# pragma: no cover" to exclude some statements from being included +in the coverage analysis. The line with that comment is excluded. If +the line is an if, while, def, or similar, with a "body", the body +is also excluded. For example: + + if always_true_during_testing: + print foo + else: # pragma: no cover + print bar + +The last two lines of codes are excluded from coverage analysis even +if the test suite does not execute them. + +You should only use this after thorough consideration. + + Your tests are too slow ======================= diff --git a/debian/changelog b/debian/changelog index 01bad45..e0b8ac8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +python-coverage-test-runner (1.1-1) unstable; urgency=low + + * New upstream version. + + -- Lars Wirzenius <liw@iki.fi> Sun, 18 May 2008 16:42:11 +0300 + python-coverage-test-runner (1.0-2) unreleased; urgency=low * debian/copyright: Fixed wording to point out explicitly that version @@ -1,7 +1,7 @@ from distutils.core import setup setup(name='CoverageTestRunner', - version='1.0', + version='1.1', description='fail Python program unit tests unless they test everything', long_description='''\ CoverageTestRunner runs unit tests implemented using the unittest module |