Repository navigation
Conversation
Add tests for the lines and branches that were still uncovered: - login: retrying after an invalid API key, and _is_valid_apikey itself (status code handling and the URL built from the endpoint), which the existing tests always mocked. - cancel: --force skipping the confirmation prompt, and an unexpected error from parse_job_key becoming a SubcommandException. - image/run/wrapper: main() and running the module as a script. - exceptions: was already fully covered through other tests; add direct tests for exit codes, default and custom messages, and print_warning. The wrapper tests patch os.mkfifo with create=True because it does not exist on Windows, where CI also runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #517 +/- ##
==========================================
+ Coverage 93.10% 94.61% +1.51%
==========================================
Files 38 38
Lines 2567 3269 +702
==========================================
+ Hits 2390 3093 +703
+ Misses 177 176 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Member
|
AdrianAtZyte
approved these changes
Oct 27, 2026
The exit code checks repeated the values from shub/exceptions.py, and shub/exceptions.py stays at 100% coverage without them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
Done in fbda1eb: kept only |
wRAR
approved these changes
Nov 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Brings
shub/login.py,shub/cancel.pyandshub/image/run/wrapper.pyto 100% line and branch coverage, and adds direct tests forshub/exceptions.py.login: retrying after an invalid API key, and_is_valid_apikeyitself (status code handling and the URL built from the endpoint), which the existing tests always mocked.cancel:--forceskipping the confirmation prompt, and an unexpected error fromparse_job_keybecoming aSubcommandException.image/run/wrapper:main(), and running the module as a script (samerunpyapproach astests/test_main.py).exceptions: already fully covered through other tests; added direct tests for exit codes, default and custom messages, andprint_warning.Notes
os.mkfifowithcreate=True, since it does not exist on Windows.tmp_pathinstead ofisolated_filesystem, which Click deprecates.shub/.Test plan
pytest --cov=shub --cov-branch shub tests: 399 passed, 3 skipped; the four files at 100%.python-dotenv==1.0.0) and 3.14: all pass.os.mkfiforemoved, to mimic Windows.pre-commit run --all-files: passes.🤖 Generated with Claude Code