r.proj: replace gunittest testsuite with pytest method reference tests - #7766
Open
krcoder123 wants to merge 3 commits into
Open
r.proj: replace gunittest testsuite with pytest method reference tests#7766krcoder123 wants to merge 3 commits into
krcoder123 wants to merge 3 commits into
Conversation
Replace the r.proj gunittest testsuite with a pytest module of seven parametrized reference tests, one per interpolation method (nearest, bilinear, bicubic, lanczos, bilinear_f, bicubic_f, lanczos_f). Each runs r.proj serially on a generated 50x50 input and checks r.univar statistics against reference values captured from the serial r.proj module (md5 cde07de7) at rel=1e-7; tests/conftest.py builds the source project and input rasters. Suggested in the review of OSGeo#7627 so the parallelization PR stays smaller and serial regressions are caught here. The gunittest testsuite also held four output-format tests (test_list_output_plain, test_list_output_json, test_print_output_plain, test_print_output_json) exercising the -l and -p flags; these are dropped in the migration and not reproduced in pytest.
petrasovaa
reviewed
Jul 29, 2026
| @@ -0,0 +1,75 @@ | |||
| """Fixtures for the r.proj parallel-correctness pytest. | |||
|
|
|||
| Builds one GISDBASE holding an EPSG:4326 source project with two small | |||
Contributor
There was a problem hiding this comment.
This is way too long. Keep it short, as if you would write it without AI.
Contributor
Author
There was a problem hiding this comment.
I reduced the conftest docstring size and cleaned up the comments. I also added some of the tests that were missing from this PR but were in the old testsuite. Please let me know if this looks good now, thanks.
The method reference test carried its provenance and tolerance reasoning in a long docstring and an inline comment. That kind of background belongs in the history, so it lives here now and the test file stays short. The reference statistics come from the serial r.proj on the main branch, run single-threaded on the input_mid fixture. The seven methods each produce distinct numbers, and the fixture is curved enough that mixing up any two of them, including the fallback variants, shows up in the statistics the test checks.
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.
This PR replaces the r.proj gunittest testsuite with pytest. It has seven parametrized reference tests, one test for each interpolation method (nearest, bilinear, bicubic, lanczos, bilinear_f, bicubic_f, lanczos_f). It checks r.univar statistics against reference values taken from the serial module. It also has four tests for the -l and -p flags covering what the old testsuite tested there. The input is a generated 50x50 raster reprojected from EPSG:4326 into EPSG:3857.