Repository navigation
Characterize RenderWindow's event dispatch, clock and repeated close - #54
Merged
dmccoystephenson merged 1 commit intoOct 30, 2026
Merged
Conversation
Lock in that a QUIT event ends dispatch for the rest of its poll, that handlers run in registration order for each event, that no further polling happens once QUIT has been seen, that one Clock serves every tick, and that each close() call shuts Pygame down again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Self-review rubric (Stage B, characterization only):
Findings and judgment calls:
Verdict: ready to merge. This review comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
dmccoystephenson
deleted the
feature/characterize-render-window-dispatch
branch
October 30, 2026 06:40
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
A Stage B (unit-test expansion) cycle on
RenderWindow. Six characterization tests are added totests/test_render_window.py, covering behaviour ofrender_window.pythat no existing test asserted. No production code is changed.should_continue()returnsTruewhen no events are pending.QUITevent is seen, the rest of the events in that poll are not passed to handlers (the loop returns early).QUIT, latershould_continue()calls returnFalsewithout pollingpygame.event.get()again, and Pygame is not shut down untilclose()is called.pygame.time.Clockis created in__init__and used by everytick().close()call runspygame.quit()again. This is what the docstring's "Calling this more than once is harmless" currently means: the call is repeated, not skipped.No tracking issue: the gap was found during triage. The README's description of the test suite (which modules mock Pygame) still holds, since
tests/test_render_window.pyalready mocked it, so no documentation change is needed.Test plan
python -m py_compile main.py graphik.py __init__.py render_window.py headless_run.py usage_reporting.py trace_client.pyruns without errors.python -m unittest tests.test_render_windowran 16 tests and all passed (10 before this PR).python -m unittest discover -s testsran 156 tests and all passed (150 onmain).return Falsein theQUITbranch ofshould_continue()tocontinuemakestest_events_after_quit_in_the_same_poll_are_not_dispatchedfail. With the source restored, it passes again.Testsworkflow is green on this PR.Deferred issues
Vironsubmodule re-pinned, and the loop does not change that without explicit authorization.This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
🤖 Generated with Claude Code
drafted by Claude on behalf of Daniel Stephenson