summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@iki.fi>2008-05-18 16:42:30 +0300
committerLars Wirzenius <liw@iki.fi>2008-05-18 16:42:30 +0300
commited17057e15518b87fcb27ef40367496b844a14bf (patch)
treee540a3f3b54f82bd3b8fde4b2a756443afac2cc5
parent120cf2d9ccc371919507a2759e2f1f4aa00e6b25 (diff)
parente724978b90f5060e7aebb6be271b40f10e643514 (diff)
downloadcoverage-test-runner-ed17057e15518b87fcb27ef40367496b844a14bf.tar.gz
New upstream version.
-rw-r--r--CoverageTestRunner.py1
-rw-r--r--NEWS7
-rw-r--r--README19
-rw-r--r--debian/changelog6
-rw-r--r--setup.py2
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)
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..d91e16d
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,7 @@
+NEWS about CoverageTestRunner
+=============================
+
+Version 1.1, released 2008-05-18
+--------------------------------
+
+Added support for '#pragma: no cover'.
diff --git a/README b/README
index 533bff4..fb58879 100644
--- a/README
+++ b/README
@@ -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
diff --git a/setup.py b/setup.py
index 558c0d6..be75c23 100644
--- a/setup.py
+++ b/setup.py
@@ -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