Skip to content

test: 13 tests for segmentation module (previously uncovered)#29

Open
hai-pilgrim wants to merge 1 commit intomarksverdhei:mainfrom
hai-pilgrim:test/segmentation-coverage
Open

test: 13 tests for segmentation module (previously uncovered)#29
hai-pilgrim wants to merge 1 commit intomarksverdhei:mainfrom
hai-pilgrim:test/segmentation-coverage

Conversation

@hai-pilgrim
Copy link
Copy Markdown

Summary

  • Tests for spritegrid/segmentation.py, which had no existing tests
  • generate_segment_masks: output shape matches input, RGBA input uses first 3 channels, two-region image doesn't crash, None returned when all noise
  • show_mask: fixed color → deterministic RGB values, random_color=True produces different results on different seeds, all-zero mask → all-zero overlay, output has 4 channels
  • make_background_transparent: returns 2-tuple, first element is PIL image, debug=False returns None for debug image, no crash on uniform image

Test plan

  • 13 tests, all passing: uv run pytest tests/test_segmentation.py -q

🤖 Generated with Claude Code

Covers generate_segment_masks (2D output/None shape, RGBA input,
two-region image, no crash), show_mask (fixed vs random color, zero mask
→ zero overlay, 4-channel RGBA output), and make_background_transparent
(tuple return, PIL image first element, debug=False → None debug image,
no crash on uniform image).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants