summaryrefslogtreecommitdiff
path: root/lab
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2010-07-12 07:19:36 -0400
committerNed Batchelder <ned@nedbatchelder.com>2010-07-12 07:19:36 -0400
commitf4975abef6f8c070523b713aa693afbb76170de8 (patch)
tree747236674ff38c18d96699620993952b8b2ce080 /lab
parenta675cb0a4b23a3f31bea9c9f83d472bfd81cb019 (diff)
downloadpython-coveragepy-f4975abef6f8c070523b713aa693afbb76170de8.tar.gz
Some notes about how the nose plugin works.
Diffstat (limited to 'lab')
-rw-r--r--lab/cover-plugin.txt54
1 files changed, 54 insertions, 0 deletions
diff --git a/lab/cover-plugin.txt b/lab/cover-plugin.txt
new file mode 100644
index 0000000..927fff8
--- /dev/null
+++ b/lab/cover-plugin.txt
@@ -0,0 +1,54 @@
+== nose cover plugin flow ==
+
+- configure:
+ set self.coverPackages: list of names of packages
+
+- begin:
+ self.skipModules = sys.modules.keys()[:]
+ set coverage.exclude (why?)
+ coverage.start
+
+
+- report:
+ coverage.stop()
+ modules = [ module
+ for name, module in sys.modules.items()
+ if self.wantModuleCoverage(name, module) ]
+ coverage.report(modules)
+
+- wantModuleCoverage(name, module):
+ if self.coverPackages:
+ for package in self.coverPackages:
+ want_it = False
+ if name.startswith(package):
+ if self.coverTests:
+ want_it = True
+ else:
+ want_it = not self.conf.testMatch.search(name)
+ if want_it:
+ return True
+ if name in self.skipModules:
+ return False
+
+ if self.conf.testMatch.search(name) and not self.coverTests:
+ return False
+
+ return not self.coverPackages
+
+- wantFile:
+
+
+
+
+source, include, omit:
+
+ # self.source is a list of canonical directories for the packages.
+ # canon_dir is the canonical directory containing the source file.
+
+ if self.source:
+ for s in self.source:
+ if is_contained(s, canon_dir):
+ break
+ else:
+ # This file wasn't in any source.
+ return False