Add test coverage for FishE.play() and error-recovery paths - #130
Merged
Conversation
…aths fishE.py's core game loop (play()) had zero test coverage, along with several load/save exception-handling branches and the timeService.json load path in __init__. Coverage for the file goes from 77% to 99% (only the __main__ entry point remains untested). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Member
Author
|
Self-review rubric:
Repo-specific:
Net effect: |
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
src/fishE.py's core game loop (play()) had zero test coverage — every line inside it (location transitions, milestone announcements, eviction messages, goal announcement, per-tick save) was unexercised.loadStats/loadTimeServicecorrupt-file recovery,save()'s missing-data-directory creation and write-failure handling, and the__init__path that loadstimeService.jsonwhen present (previously only the "file absent" branches were tested).src/fishE.pyline coverage goes from 77% to 99% (the remaining 2 lines are theif __name__ == "__main__":entry point, which isn't unit-testable).Full backlog note: the repo's one open issue (#122, whether the stale
PLANNING.mdGOALS bait-price note should be deleted) requires the repo owner's memory of the original symptom to resolve safely, so it's intentionally left open/deferred rather than acted on this cycle.Test plan
python3 -m compileall -q srcSDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy python3 -m pytest— 402 passedpytest --cov=src --cov-report=term-missing—src/fishE.py77% → 99%, repo total 95% → 96%