Skip to content

r.proj: replace gunittest testsuite with pytest method reference tests - #7766

Merged
petrasovaa merged 4 commits into
OSGeo:mainfrom
krcoder123:fix-rproj-tests
Aug 21, 2026
Merged

petrasovaa merged 4 commits into
OSGeo:mainfrom
krcoder123:fix-rproj-tests

Conversation

@krcoder123

@krcoder123 krcoder123 commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

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.

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.
@github-actions github-actions Bot added raster Related to raster data processing Python Related code is in Python module tests Related to Test Suite labels Jul 23, 2026
Comment thread raster/r.proj/tests/conftest.py Resolved
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.
Comment thread raster/r.proj/tests/conftest.py Resolved
Comment thread raster/r.proj/tests/conftest.py Resolved
@krcoder123
krcoder123 requested a review from petrasovaa August 20, 2026 21:51
@petrasovaa
petrasovaa merged commit 63e582d into OSGeo:main Aug 21, 2026
26 checks passed
@github-actions github-actions Bot added this to the 8.6.0 milestone Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module Python Related code is in Python raster Related to raster data processing tests Related to Test Suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants