Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude if TYPE_CHECKING: blocks from coverage #191

Merged
merged 1 commit into from
Jan 17, 2025

Conversation

seanh
Copy link
Contributor

@seanh seanh commented Jan 10, 2025

This is extracted from
#188 as a separate PR.

This commit also adds includes for per-project overriding or extending
of the coverage excludes:

  • If a project has a .cookiecutter/includes/coverage/exclude_also file
    that will replace the cookiecutter's default exclude_also's

  • If a project has a .cookiecutter/includes/coverage/exclude_also/tail file
    that will extend the cookiecutter's default exclude_also's

Also fix a bug in local_extensions.py's include_exists(path) function:
don't crash if there's a folder (rather than a file) at path (the
code was catching the wrong exception class, looks like just a mistake).

This is extracted from
#188 as a separate PR.

This commit also adds includes for per-project overriding or extending
of the coverage excludes:

* If a project has a `.cookiecutter/includes/coverage/exclude_also` file
  that will _replace_ the cookiecutter's default `exclude_also`'s

* If a project has a `.cookiecutter/includes/coverage/exclude_also/tail` file
  that will _extend_ the cookiecutter's default `exclude_also`'s

Also fix a bug in `local_extensions.py`'s `include_exists(path)` function:
don't crash if there's a _folder_ (rather than a file) at `path` (the
code was catching the wrong exception class, looks like just a mistake).
@seanh seanh force-pushed the exclude-TYPE_CHECKING-blocks-from-coverage branch from 731fa0e to d2e7938 Compare January 17, 2025 13:45
@seanh seanh merged commit 7a99520 into main Jan 17, 2025
4 checks passed
@seanh seanh deleted the exclude-TYPE_CHECKING-blocks-from-coverage branch January 17, 2025 13:46
seanh added a commit that referenced this pull request Jan 17, 2025
seanh added a commit that referenced this pull request Jan 17, 2025
seanh added a commit that referenced this pull request Jan 17, 2025
seanh added a commit that referenced this pull request Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants