Source / lab / cover-plugin.txt

== nose cover plugin flow ==

- configure:
    set self.coverPackages: list of names of packages

- begin:
    self.skipModules = sys.modules.keys()[:]
    set coverage.exclude (why?)

- report:
    modules = [ module
            for name, module in sys.modules.items()
            if self.wantModuleCoverage(name, module) ]

- wantModuleCoverage(name, module):
    if self.coverPackages:
        for package in self.coverPackages:
            want_it = False
            if name.startswith(package):
                if self.coverTests:
                    want_it = True
                    want_it = not
                if want_it:
                    return True
    if name in self.skipModules:
        return False

    if 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):
            # This file wasn't in any source.
            return False