Kumar McMillan committed 98f0073

Fixes bug in coverage where module names were not matched accurately (Issue 433)

  • Participants
  • Parent commits 3805927

Comments (0)

Files changed (3)

 Buck Golemon
 Bobby Impollonia
 Takafumi Arakaki
+Peter Bengtsson
 - Revised multiprocessing implementation so that it works for test generators
   (#399). Thanks to Rosen Diankov for the patch.
 - Fixes Xunit plugin for reporting generator tests (#369)
 - Fixed subtle bug in ``--first-package-wins`` that made it unpredictable
+- 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)

File nose/plugins/

 import logging
 import os
+import re
 import sys
 from nose.plugins.base import Plugin
 from nose.util import src, tolist
             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
                     log.debug("coverage for %s", name)