tester: cover all uncovered branches in PopulationStorage#146
Open
bugsyhewitt wants to merge 1 commit into
Open
tester: cover all uncovered branches in PopulationStorage#146bugsyhewitt wants to merge 1 commit into
bugsyhewitt wants to merge 1 commit into
Conversation
Adds 9 tests targeting the 12 uncovered lines (7 branch gaps) in storage.py: default populations_root path, entries/stats dir missing early-returns, non-json file skip in iteration, current_generation without metadata, clear() no-op when root absent, and both sub-paths of the _atomic_write_json exception cleanup (successful unlink and FileNotFoundError-swallowed unlink). storage.py now reaches 100% branch coverage. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
What
Adds 9 tests to
test/evolution/test_storage.pyclosing 12 uncovered lines and 7 branch gaps insrc/alienclaw/evolution/storage.py. No production code changes.Coverage before: 84% (12 missed lines, 7 branch partials)
Coverage after: 100% (0 missed)
Branches covered:
populations_root()default path (env var absent)test_populations_root_uses_home_defaultread_all_entries()whenentries_dirmissingtest_read_all_entries_when_entries_dir_missingread_all_entries()test_read_all_entries_skips_non_jsonread_all_stats()whenstats_dirmissingtest_read_all_stats_when_stats_dir_missingread_all_stats()test_read_all_stats_skips_non_jsoncurrent_generation()without metadatatest_current_generation_without_metadataclear()no-op when root absenttest_clear_when_root_does_not_exist_atomic_write_jsonexception + temp cleanuptest_atomic_write_cleanup_on_write_failure_atomic_write_jsonunlink raisesFileNotFoundErrortest_atomic_write_tmp_already_gone_on_cleanupShip-gate
🤖 Generated with Claude Code