diff options
author | kumar <kumar.mcmillan@gmail.com> | 2011-07-08 10:52:40 -0500 |
---|---|---|
committer | kumar <kumar.mcmillan@gmail.com> | 2011-07-08 10:52:40 -0500 |
commit | 35624a20de3702a31bda140bad303a9afcd30113 (patch) | |
tree | 97f6123f48d7f45f93bde4b3e7eaacbc513d5096 | |
parent | ce179d4bc6df51f5052f7c86abd7c6b2caa6bb42 (diff) | |
download | nose-35624a20de3702a31bda140bad303a9afcd30113.tar.gz |
Fixes bug in coverage where module names were not matched accurately (Issue 433)
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | CHANGELOG | 4 | ||||
-rw-r--r-- | nose/plugins/cover.py | 3 |
3 files changed, 6 insertions, 2 deletions
@@ -19,3 +19,4 @@ Rosen Diankov Buck Golemon Bobby Impollonia Takafumi Arakaki +Peter Bengtsson @@ -1,4 +1,4 @@ -1.0.1 +1.1.0 - Revised multiprocessing implementation so that it works for test generators (#399). Thanks to Rosen Diankov for the patch. @@ -15,6 +15,8 @@ - Fixes Xunit plugin for reporting generator tests (#369) - Fixed subtle bug in ``--first-package-wins`` that made it unpredictable (#293) +- Fixes coverage module names -- 'cal' used to also match calendar which was a + bug (#433) - Fixes case where teardown_class() was called more than once (#408). Thanks to Heng Liu for the patch. - Makes --plugins more succinct when there are no options (#235) diff --git a/nose/plugins/cover.py b/nose/plugins/cover.py index 371d9f5..259bf0c 100644 --- a/nose/plugins/cover.py +++ b/nose/plugins/cover.py @@ -12,6 +12,7 @@ variable. """ import logging import os +import re import sys from nose.plugins.base import Plugin from nose.util import src, tolist @@ -274,7 +275,7 @@ class Coverage(Plugin): return False if self.coverPackages: for package in self.coverPackages: - if (name.startswith(package) + if (re.findall(r'^%s\b' % re.escape(package), name) and (self.coverTests or not self.conf.testMatch.search(name))): log.debug("coverage for %s", name) |