# HG changeset patch -- Bitbucket.org
# Project pytest-coverage
# URL http://bitbucket.org/prologic/pytest-coverage/overview/
# User prologic
# Date 1265830270 -36000
# Node ID fe73865f34061f59c9e686c00e36dd482daa398e
# Parent 0c3f822762f567e2f03716fa30bde77ea089e788
pytest_coverage.py: Only build a list of modules to restrict in the output 
report if self.coverPackage is not None (otherwise display all modules).

--- a/pytest_coverage.py
+++ b/pytest_coverage.py
@@ -54,9 +54,12 @@ class CoverageTestWrapper(object):
         self.coverage.stop()
         self.coverage.save()
 
-        modules = [module
-                for name, module in sys.modules.items()
-                if module is not None and name.startswith(self.coverPackage)]
+        modules = []
+        if self.coverPackage is not None:
+            modules = [module
+                    for name, module in sys.modules.items()
+                    if module is not None and \
+                            name.startswith(self.coverPackage)]
         
         # Remaining actions are reporting, with some common self.options.
         report_args = {
_______________________________________________
py-svn mailing list
py-svn@codespeak.net
http://codespeak.net/mailman/listinfo/py-svn

Reply via email to