diff options
author | Lars Wirzenius <liw@iki.fi> | 2008-05-18 16:38:48 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@iki.fi> | 2008-05-18 16:38:48 +0300 |
commit | c49fee7c37e71413641ccaa34b9a8b2b2cdb93a1 (patch) | |
tree | 09182047ad67ae947c5ccfd061352bea790e0169 /README | |
parent | a8447c673d037833dc3ccecb832be83807839dd7 (diff) | |
download | coverage-test-runner-c49fee7c37e71413641ccaa34b9a8b2b2cdb93a1.tar.gz |
Added a description of the '#pragma: no cover' in the README.
Diffstat (limited to 'README')
-rw-r--r-- | README | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -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 ======================= |