-
Notifications
You must be signed in to change notification settings - Fork 28
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
Bring test coverage to 100%, reorganize tests #70
Conversation
Codecov Report
@@ Coverage Diff @@
## main #70 +/- ##
===========================================
+ Coverage 76.09% 99.91% +23.82%
===========================================
Files 25 22 -3
Lines 1368 1207 -161
===========================================
+ Hits 1041 1206 +165
+ Misses 327 1 -326
Continue to review full report at Codecov.
|
@nclack, let me know if you'd like time to review this PR. I know we're in a holiday stretch here, so I expect you won't be as active as usual. This PR has the potential to conflict with anything else I work on though, so I'd prefer to get it in sooner than later. (as mentioned, it really doesn't touch much of the logic in the code, just completes coverage) |
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.
amazing. I flagged a couple pragmas, but I don't feel strongly. It's so nice to have this.
npe2/_plugin_manager.py
Outdated
@@ -313,7 +309,7 @@ def get_writer( | |||
|
|||
for writer in self.iter_compatible_writers(layer_types): | |||
if plugin_name and not writer.command.startswith(plugin_name): | |||
continue | |||
continue # pragma: no cover |
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.
This will get hit when a user has multiple single-image-layer writers installed (from different plugins) and is querying by plugin_name.
Right now I believe the testing is focused on environments with just one test plugin installed. Should we add another to cover this?
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.
the logic of simply continuing is simple enough. But I refactored out the continue
and the pragma with if not plugin_name or writer.command.startswith(plugin_name):
This brings complete test coverage to npe2, (and requires 100% for future PRs).
I tried to touch as little of the actual code as possible, but inevitably needed to shuffle a few things around (like validators, etc...) hopefully it's not too hard to review. But, it's all tested! 😂
you'll see a lot of
# pragma: no cover
... mostly they are on exceptions and loop continuations, those are fine with me (mocking test cases that specifically fail those conditions just to see the exception get raised is not terribly useful, and each one indicates that a human has considered that line). I'm fine with using# pragma: no cover
going forward when it feels like a "trivial" thing that