Skip to content

v.what.strds: migrate tests from gunittest to pytest - #7898

Draft
Valyrian-Code wants to merge 2 commits into
OSGeo:mainfrom
Valyrian-Code:v.what.strds-pytest
Draft

v.what.strds: migrate tests from gunittest to pytest#7898
Valyrian-Code wants to merge 2 commits into
OSGeo:mainfrom
Valyrian-Code:v.what.strds-pytest

Conversation

@Valyrian-Code

Copy link
Copy Markdown
Contributor

Migrates the v.what.strds testsuite from gunittest to pytest, continuing the one-at-a-time migrations from #7635/#7675/#7780/#7893/#7894/#7896.

Same setup and cases as before: a small strds with four registered rasters of known values, three points at the same location, checking that v.what.strds creates the output map and that every point's sampled value matches the registered raster for each time slot.

Verified locally, both pass.

@github-actions github-actions Bot added vector Related to vector data processing Python Related code is in Python module tests Related to Test Suite labels Sep 6, 2026
@Valyrian-Code

Copy link
Copy Markdown
Contributor Author

Same CI infra issue as noted on #7780: the failing checks are hitting an HTTP 504 from Launchpad while adding the ubuntugis-unstable PPA, unrelated to this PR. Should clear with a re-run.

@ninsbl ninsbl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rewrite with pytest looks good. That said, the test unfortunately does not really test the result correctness in a reliable way.
The raster maps contain only 1 value at a time, so one would not notice if e.g. points order gets mixed up. It would be better to create e.g. ranrom rasters or rasters where pixel values are x * y, along with a vector map with known point locations, so also pixel-shifts or point-reordering would ret noticed in the output.
That said, I have no objections merging this.

@Valyrian-Code

Copy link
Copy Markdown
Contributor Author

Thanks for the review and for merging this as is. Good point on the raster values, using position-dependent values (like x*y) with points at known locations would catch ordering or position bugs that flat single-value rasters can't. I will keep that in mind for the next few migrations.

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 tests Related to Test Suite vector Related to vector data processing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants