test(core): exercise the source decorator's normalizer parameter - #319
Merged
Conversation
The two skipped tests in the workspace were both this suite refusing to test `@il.source(normalizer=...)`: its sample value was `None`, and a `None`-valued parameter is dropped by `_split_params` before it reaches the built class, so the skip existed because the value could never have proved anything. The parameter works — a real `Normalizer()` routes through both the function and the class form and lands as the built class's field default. So the sample value becomes a real normalizer, the two skips go, and the whole advertised decorator surface is now genuinely exercised rather than nine tenths of it. A `None` sample value would silently reintroduce the hole (the test would pass while testing nothing), so it is now an assertion of its own rather than a skip. By Digitl
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.
The workspace's only two skipped tests were both this suite refusing to test one decorator parameter. Zero skips now (2535 passed, 0 skipped).
What the skips were hiding
tests/source/test_decorator.pyexercises the whole advertised@il.source(...)surface generically: for each keyword parameter, build a source with it and assert the class builds — "a routed name with no matching field crashes at build". A per-parameter sample value drives it.normalizer's sample value wasNone, and both tests skipped on it:That skip could never have been satisfiable: the decorator's
_split_paramsdropsNone-valued parameters before they reach the built class, so aNonesample would exercise nothing even if it ran. The effect was thatnormalizer— one of the ten advertised parameters — was the one the suite never checked, while reading as if it did.The fix
The parameter works fine. A real
Normalizer()routes through both the function and the class form and lands as the built class's field default:So the sample value becomes a real normalizer and both skips go. The full surface is now genuinely exercised rather than nine tenths of it.
Guarding the regression
A
Nonesample value would silently reopen the hole — the parametrized test would pass while testing nothing — so that's now an assertion rather than a skip:Verified it bites: putting
Noneback fails that test rather than quietly skipping.Verification
uv run ruff check,uv run ty checkand the full workspace suite all green — 2535 passed, 0 skipped (was 2533 passed, 2 skipped). Pre-commit ran the same three hooks on the commit.By Digitl