Simplify tests generated by erfa_generator.py#247
Merged
Conversation
Among other things `erfa_generator.py` translates the `erfa` tests in `t_erfa_c.c` into a Python module that can be tested with `pytest`. So far the translation has tried to change the code as little as possible, but writing Python as if it is ANSI C is not taking advantage of the features Python and `pytest` provide. A less literal translation removes the need for the `viv()` and `vvd()` test helpers and improves tracebacks if a test should fail.
cf38fa8 to
e610876
Compare
avalentino
approved these changes
May 12, 2026
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.
Among other things
erfa_generator.pytranslates theerfatests int_erfa_c.cinto a Python module that can be tested withpytest. So far the translation has tried to change the code as little as possible, but writing Python as if it is ANSI C is not taking advantage of the features Python andpytestprovide. A less literal translation removes the need for theviv()andvvd()test helpers and improves tracebacks if a test should fail. For example, with the following change to theerfa/tests/test_ufunc.pygenerated by currentmainthe resulting traceback is
but if an analogous change is made to the file generated by this PR
then the traceback is much shorter and much clearer: