test: pin drawImage's exact drawn region and its missing-file error type - #47
Merged
Merged
Conversation
Scaling to (height, width) instead of (width, height) passed every existing drawImage test, since all of them use square or single-pixel-high sizes. A non-square region drawn at an offset now pins both dimensions and the top-left anchoring to the pixel. The missing-file tests accepted FileNotFoundError or pygame.error, while the docstring promises FileNotFoundError specifically and reserves pygame.error for undecodable files. Both are tightened to the documented type. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Self-review rubric (performed inline in the same session, so it is not independent review):
Findings:
The PR is ready to merge. It contains test-only changes, no do-not-auto-merge path is touched, and CI is green. This review comment 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 targeting
drawImage. No production code is changed.test_draw_image_fills_exactly_the_requested_region. Every existingdrawImagetest scales to a square size (10x10, 12x12) or a single-pixel-high one (2x1), so nothing distinguishedwidthfromheight. A mutant scaling to(height, width)was confirmed to pass all 53 existing tests. The new test draws a non-square 6x5 region at offset (3, 4) and pins every corner plus the first pixel past each edge. That also pins the documented top-left anchoring to the pixel, mirroringtest_draw_rectangle_fills_exactly_the_requested_region.test_draw_image_missing_file_raises(renamed..._raises_file_not_found_error) andtest_draw_image_does_not_cache_a_failed_loadaccepted(FileNotFoundError, pygame.error). ThedrawImagedocstring promisesFileNotFoundErrorfor a missing path and reservespygame.errorfor undecodable files, so both now assertFileNotFoundErroronly. It was confirmed empirically thatpygame.image.loadraisesFileNotFoundErrorfor a missing.bmpor.pngpath. The comment on the neighboring undecodable-file test, which described the old loose assertion, was updated to match.No tracking issue. The gap was found during triage.
Mutation evidence
graphik.py(reverted after each run)size = (height, width)(xpos + 1, ypos)Test plan
python3 -m py_compile src/main/python/preponderous/graphik/graphik.pyimport preponderous.graphik) prints0.3.0.dev20260808python3 -m pytest: 54 passed, run locally on Python 3.8 / pygame 2.1.2 with the conftest's dummy SDL driversTestworkflow green across 3.9–3.13 (this also confirms that the newer pygame wheels raiseFileNotFoundErrortoo)Triage notes (skipped issues)
.github/workflows/and the release process, which are excluded from autonomous change..github/workflows/test.yml, which is on the do-not-auto-merge list. The issue also leaves the trigger-vs-comment choice to the maintainer.preponderous/__init__.pynamespace package): per the issue itself, this needs a maintainer check of sibling Preponderous-Software package conventions first.RELEASING.mddescribes a "canonical import" smoke test, butpublish.ymlnever importsGraphik. The workflow is at fault rather than the docs, and workflows are excluded from autonomous change. The rest of the sweep found no drift inREADME.md,RELEASING.md, or the docstrings.This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
drafted by Claude on behalf of Daniel Stephenson
🤖 Generated with Claude Code