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

Automatically add no-cover to TYPE_CHECKING blocks #874

Merged
merged 2 commits into from Oct 7, 2019

Conversation

@dmontagu
Copy link
Collaborator

dmontagu commented Oct 7, 2019

Change Summary

Adds if TYPE_CHECKING: to the exclude_lines for coverage so that the # pragma: no cover can be removed everywhere it occurs next to an if TYPE_CHECKING: block.

Note: this is safe since code inside such blocks should never be executed except during static analysis.

Checklist

  • Unit tests for the changes exist
  • Tests pass on CI and coverage remains at 100%
  • Documentation reflects the changes where applicable
  • changes/<pull request or issue id>-<github username>.rst file added describing change
    (see changes/README.md for details)
David Montague added 2 commits Oct 7, 2019
David Montague
@dmontagu

This comment has been minimized.

Copy link
Collaborator Author

dmontagu commented Oct 7, 2019

I noticed this while working on #873, but assumed it would be better to put it in a separate PR.

@codecov

This comment has been minimized.

Copy link

codecov bot commented Oct 7, 2019

Codecov Report

Merging #874 into master will not change coverage.
The diff coverage is n/a.

@@          Coverage Diff          @@
##           master   #874   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          16     16           
  Lines        2716   2716           
  Branches      518    518           
=====================================
  Hits         2716   2716
Impacted Files Coverage Δ
pydantic/color.py 100% <ø> (ø) ⬆️
pydantic/types.py 100% <ø> (ø) ⬆️
pydantic/dataclasses.py 100% <ø> (ø) ⬆️
pydantic/fields.py 100% <ø> (ø) ⬆️
pydantic/schema.py 100% <ø> (ø) ⬆️
pydantic/class_validators.py 100% <ø> (ø) ⬆️
pydantic/typing.py 100% <ø> (ø) ⬆️
pydantic/utils.py 100% <ø> (ø) ⬆️
pydantic/networks.py 100% <ø> (ø) ⬆️
pydantic/validators.py 100% <ø> (ø) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 33b7d52...aeb539e. Read the comment docs.

@samuelcolvin

This comment has been minimized.

Copy link
Owner

samuelcolvin commented Oct 7, 2019

👍 very clever/how was I too stupid to think of this before?

@dmontagu dmontagu mentioned this pull request Oct 7, 2019
4 of 4 tasks complete
@samuelcolvin samuelcolvin merged commit 425fac6 into samuelcolvin:master Oct 7, 2019
10 checks passed
10 checks passed
Header rules No header rules processed
Details
Pages changed 2 new files uploaded
Details
Redirect rules No redirect rules processed
Details
Mixed content No mixed content detected
Details
codecov/project 100% remains the same compared to 33b7d52
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
deploy/netlify Deploy preview ready!
Details
samuelcolvin.pydantic Build #20191007.39 succeeded
Details
samuelcolvin.pydantic (Job Python36) Job Python36 succeeded
Details
samuelcolvin.pydantic (Job Python37) Job Python37 succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.