Remove TestFunction.pre_process_lines()#253
Merged
avalentino merged 2 commits intoMay 21, 2026
Merged
Conversation
Among other things `erfa_generator` translates the tests in an ERFA C file into a `pytest` test suite that checks `pyerfa` ufuncs. The source code for each test is found with a regex, but so far `erfa_generator` has simply assumed a match is always found. This assumption is true with the current version of ERFA, but it might not be true with all future versions. From now on if the test for an ERFA function cannot be found the error message will contain the function's name.
The method was meant to adjust the source code of an ERFA test written in C into a more convenient format, but using Python's regex functionality allows conversion into an even more convenient format with much less code.
avalentino
approved these changes
May 21, 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.
Making better use of Python's regex functionality allows eliminating the
TestFunction.pre_process_lines()method. There are a few differences between theerfa/tests/test_ufunc.pyfiles generated by currentmainand this PR, but they are all improvements: