test: cover pre-existing defensive branches to reach 100%#321
Merged
Conversation
These pre-existing early-return guards and helper edge cases were uncovered in the combined CI coverage report. Add targeted unit tests for get_name, ensure_list/ensure_dict, get_dynamic, config_error's got_type branch, _validate_import_names, and the validate_via_prefix wrong-type guards so coverage reaches 100%. Assisted-by: ClaudeCode:claude-opus-4.8
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.
🤖 AI text below 🤖
The combined CI coverage report has several pre-existing uncovered lines (defensive
if not isinstance(...): returnguards and a few helper edge cases) that exist onmain, independent of any feature work. They block thecodecov/project100% target on PRs that get codecov status posted (e.g. #241).This PR adds targeted unit tests in
tests/test_internals.pycovering:_dispatch.get_name(origin-with/without-args branches) and__dir__pyproject.ensure_list/ensure_dictNone/wrong-type returnspyproject.get_dynamicerrors.ErrorCollector.config_errorgot_typebranch_validate_import_namesnon-list guardproject_table.validate_via_prefixwrong-type early returns (license, readme, version, dependencies, requires-python)No source changes — tests only. Verified locally that all previously-flagged lines are now covered; remaining local misses are version-specific blocks covered by the 3.8/3.9 matrix jobs.