test: pin that draw methods render to the bound surface, not the display - #48
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Self-review rubric (Graphik dev loop, Phase 4), scored against the diff and command output:
Finding raised and fixed during review:
Do-not-auto-merge check: there are no workflow, This review was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
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 (unit-test expansion) cycle: no production code is changed.
Graphikclass docstring states that every draw method "renders to the surface the instance was constructed with". Every existing test bindsGraphikto the display surface itself, so nothing distinguished drawing to the bound surface from drawing topygame.display.get_surface().test_draw_methods_render_to_the_bound_surface_not_the_display, is added. It bindsGraphikto an off-screenpygame.Surfaceand runs each ofdrawRectangle,drawText,drawButtonanddrawImage. It then requires that the bound surface was drawn to and the display was left untouched.No tracking issue: the gap was found during triage by comparing the class docstring with the existing tests.
Evidence the test pins real behavior
The three draw targets in
graphik.py(pygame.draw.rect(self.gameDisplay, …)and bothself.gameDisplay.blit(…)calls) were temporarily replaced withpygame.display.get_surface():Test plan
python3 -m py_compile src/main/python/preponderous/graphik/graphik.pyfrom preponderous.graphik import Graphikpython3 -m pytest: 58 passed, run headless throughconftest.py's dummy SDL driversDeferred issues (skip reasons)
.github/workflows/, which is excluded from autonomous change. release: version tags are pushed without the 'v' prefix publish.yml requires, so no release has ever been published #34 also needs a maintainer decision on tagging.preponderous.*namespace convention used across sibling projects.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