Skip to content

Conversation

@nanxstats
Copy link
Owner

@nanxstats nanxstats commented Sep 12, 2025

This PR adds generic, low-maintenance unit tests to the package. These tests are designed to be parametrized and introspection-driven to minimize boilerplate and stay resilient to future new palettes/scales.

  • tests/test_utils.py: hex/rgb round-trip, alpha application (#RRGGBBAA), color interpolation endpoints and sampling.
  • tests/test_palettes.py: introspection across all pal_* functions; discrete and continuous behavior, reverse ordering, alpha handling, and error cases (unknown palette, invalid alpha).
  • tests/test_scales.py: discrete scale dataclasses (_aesthetics, palette callable, alpha via InitVar), continuous factories return types (gradientn), British alias identity, and package root export alignment.

Code coverage is 100%.

@nanxstats nanxstats merged commit 9e31360 into main Sep 12, 2025
6 checks passed
@nanxstats nanxstats deleted the tests branch September 12, 2025 02:23
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