Skip to content

tester: cover all uncovered branches in PopulationStorage#146

Open
bugsyhewitt wants to merge 1 commit into
mainfrom
test/storage-branch-coverage
Open

tester: cover all uncovered branches in PopulationStorage#146
bugsyhewitt wants to merge 1 commit into
mainfrom
test/storage-branch-coverage

Conversation

@bugsyhewitt

Copy link
Copy Markdown
Owner

What

Adds 9 tests to test/evolution/test_storage.py closing 12 uncovered lines and 7 branch gaps in src/alienclaw/evolution/storage.py. No production code changes.

Coverage before: 84% (12 missed lines, 7 branch partials)
Coverage after: 100% (0 missed)

Branches covered:

Gap Lines Test
populations_root() default path (env var absent) 32 test_populations_root_uses_home_default
read_all_entries() when entries_dir missing 138 test_read_all_entries_when_entries_dir_missing
Non-json file skip in read_all_entries() 142 test_read_all_entries_skips_non_json
read_all_stats() when stats_dir missing 153 test_read_all_stats_when_stats_dir_missing
Non-json file skip in read_all_stats() 157 test_read_all_stats_skips_non_json
current_generation() without metadata 171 test_current_generation_without_metadata
clear() no-op when root absent 177→exit test_clear_when_root_does_not_exist
_atomic_write_json exception + temp cleanup 190–195 test_atomic_write_cleanup_on_write_failure
_atomic_write_json unlink raises FileNotFoundError 193–194 test_atomic_write_tmp_already_gone_on_cleanup

Ship-gate

vitest: 95 passed | 1 skipped (96) — 1629 passed | 40 skipped
pytest: 1134 passed, 125 skipped, 5 warnings (+9 from main's 1125)
ruff:   All checks passed

🤖 Generated with Claude Code

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>
@bugsyhewitt bugsyhewitt added the tester opened by a Tester agent label Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tester opened by a Tester agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant