-
-
Notifications
You must be signed in to change notification settings - Fork 344
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
get and enforce 100% coverage #3159
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3159 +/- ##
====================================================
+ Coverage 99.62461% 100.00000% +0.37538%
====================================================
Files 124 124
Lines 18381 18427 +46
Branches 1226 1215 -11
====================================================
+ Hits 18312 18427 +115
+ Misses 47 0 -47
+ Partials 22 0 -22
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't see anything imminently except for a mypy issue
src/trio/_core/_tests/test_io.py
Outdated
@@ -381,6 +384,38 @@ def check(*, expected_readers: int, expected_writers: int) -> None: | |||
check(expected_readers=1, expected_writers=0) | |||
|
|||
|
|||
@pytest.mark.skipif(sys.platform in {"win32", "linux"}, reason="no kqueue") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From mypy run annotations, looks like you need to inform mypy that you don't expect this function to run on windows or linux, because mypy doesn't understand pytest.mark.skipif
.
I suggest something like this:
if sys.platform == "win32" or sys.platform == "linux":
raise AssertionError("Should be unreachable")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@CoolCat467 perhaps, assert_never()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or better yet assert sys.platform not in {"win32", "linux"}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't get either option working (assert sys.platform != "win32" and sys.platform != "linux") does work in the playground, and if I create a new file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prior comment
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
This reverts commit be08460.
.codecov.yml
Outdated
project: | ||
default: | ||
target: 100% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FTR with #3162, there's going to be a need to split the checks into MyPy vs. pytest.
"abc.abstractmethod", | ||
"if TYPE_CHECKING.*:", | ||
"if _t.TYPE_CHECKING:", | ||
"if t.TYPE_CHECKING:", | ||
"@overload", | ||
'class .*\bProtocol\b.*\):', | ||
"raise NotImplementedError", | ||
'TODO: test this line' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider integrating the covdefaults
plugin, as it injects most of these automatically. The only thing you'd need to override additionally is the fail_under
setting, which it sets to 100%, but it's not compatible with runtime-dependent tests that cannot reach 100% under one specific runtime. So it's good to set it to something sufficiently low while requiring 100% in Codecov.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah nice, I'll do that in a followup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, I forgot to submit my pending comments I wrote yesterday
Co-authored-by: John Litborn <[email protected]>
for more information, see https://pre-commit.ci
Co-authored-by: John Litborn <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
Using a combination of more tests and TODO comments that work as coverage pragmas