Test pygame showOptions selection paths#99
Merged
Conversation
showOptions is the pygame UI's primary menu loop and was the last interactive method with no coverage. Its three input paths now have tests (events injected via the patched pygame.event.get): a number key selects directly, arrow-down + Enter moves the highlight and confirms it, and an out-of-range number key is ignored until a valid choice is pressed. With this, the pygame front-end's resize/font helpers and all four interactive primitives (showOptions / showDialogue / promptForText / timedKeyPress) are covered. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
dmccoystephenson
left a comment
Member
Author
There was a problem hiding this comment.
Self-review:
- Scope: PASS — pygame test file only; characterization, no prod change.
- Tests-new: PASS — number-key, arrow+Enter, and out-of-range-guard paths of showOptions were uncovered.
- Headless-pygame: PASS — injected events; CI green (221). Completes pygame interactive coverage.
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
Stage B test-expansion (final):
showOptions— the pygame UI's primary menu loop — was the last interactive method with no coverage.tests/ui/test_pygameUserInterface.py: a number key selects directly; arrow-down + Enter moves the highlight and confirms (["A","B","C"]→ "2"); an out-of-range number key (9with 2 options) is ignored until a valid one is pressed.This completes the pygame front-end's interactive coverage (resize/font helpers +
showOptions/showDialogue/promptForText/timedKeyPress). Characterization only; headless under dummy SDL.Test plan
SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy python3 -m pytest— 221 passed (3 new)🤖 Generated with Claude Code