When you run your code, the coverage launch command will by default measure all the code if it is not part of the Python standard library.
You can specify the source to measure using the command line -source switch or the [run] configuration value. Value is a list of directories or package names. If indicated, only the source inside these directories or packages will be measured. Specifying the source option also allows cover.py to report outstanding files, since it can search the source tree for files that have been measured on everything. Only imported files (alone in the root of the tree or in directories with the __init__.py file), and files with unusual punctuation in their names will be skipped (they are assumed to be scratched files written by text editors).
You can further fine-tune the focus on .pys scope with --include and --omit (or enable [run] and [start] omit value configuration). --include is a list of file name patterns. If specified, only files matching these patterns. --omit also list file name patterns, specifying files not for measurement. If both include and omit are specified, first the set of files is reduced to only those that match the include patterns, and then any files that match the delete pattern are removed from the set.
The include and omit file name models follow the typical shell syntax: * matches any number of characters and? matches one character. Patterns starting with a wildcard are used as-is, other patterns are interpreted relative to the current directory.
Sources, including and omitting values, all work together to determine the source to be measured.