Allow excluding entire modules/packages

Issue #118 closed
Ram Rachum created an issue

Allow excluding entire modules/packages from coverage measurement by including some identifiable string in their source, similarly to "pragma: no cover".

Here's a suggestion on how to do this, feel free to suggest alternatives: A line "pragma: no module cover" in a module will cause it not to be measured. A "pragma: no package cover" in an file will cause the entire package, (including any submodules, subpackages, etc.) not to be measured.

Comments (4)

  1. René Fleschenberg

    Is there a reason why we cannot just use pragma: no cover at module level to exclude the whole module from coverage?

  2. Ned Batchelder repo owner

    I haven't looked into what it would take to implement this. Ram's original proposal included a new pragma for to exclude the whole package. That would need to be different than the pragma for a single module, I think.

  3. Log in to comment