Repository navigation
Rework the pad_inches test and reorganize the express API test files - #106
Merged
john-boyer-phd merged 4 commits intoSep 22, 2026
Merged
john-boyer-phd merged 4 commits into
john-boyer-phd merged 4 commits into
Conversation
Re-enable test_draw_pad_inches_controls_output_padding as a pixel test on the K5-minus-edge image with figsize=(4,3), and split the express API tests into per-endpoint files. Fixes graph-algorithms#104
john-boyer-phd
approved these changes
Sep 22, 2026
john-boyer-phd
left a comment
Member
There was a problem hiding this comment.
This looks all good, YUSUF. Thanks for helping to get the code all organized, and for the excellent test of pad_inches. It looks like something I did in draw() makes Python 3.10 a little unhappy, and your test is catching that. However, we need to change out 3.10 for 3.15 in the October timeframe anyway, so it's best to sunset 3.10 now so all tests will pass on all Pythons that will be supported by 1.1.0.
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.
Reworks the pad_inches test and splits the express API tests into per-endpoint files. Fixes #104.
The pad test is back as a pixel test on the K5-minus-edge image at figsize=(4,3): from the midpoint of each image edge it walks in and expects
pad_inches * dpibackground pixels before the drawing, for pad values 0.0, 0.1 and 0.5. On the right it starts a quarter of the way down, because the rightmost ink there is a vertical edge line that ends above the bottom vertices. With bordered vertices the run measures a pixel short, so the check allows two pixels of slack.Measured on current master: 0/10/50 background pixels at 0.0/0.1/0.5 on all four sides, with the image exactly 400x300 at every pad.
Renames: test_draw_colors.py → test_express_api_draw.py (also takes in test_draw_text, since ascii() is on the way out per #94), test_planarity.py → test_express_api_is_planar.py, test_planarity_networkx.py → test_express_api_networkx.py. The write() and kuratowski_edges() tests moved out to their own files.
Suite is 50 tests now, up from 48 — the pad test runs through both draw() entry points. One stale comment in test_png_background_and_transparency (it still says the saved image comes out smaller than the figsize) predates the figsize fix; I left it alone.