coverage.py / 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?)
    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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.