Repository navigation
tests: Add pytest coverage for the temporal framework and R-tree bindings - #7728
Merged
wenzeslaus merged 3 commits intoJul 16, 2026
Merged
Conversation
wenzeslaus
force-pushed
the
temporal-unit-tests-pytest-port
branch
from
July 16, 2026 08:03
1540924 to
126eb99
Compare
…ings Add executed pytest tests for parts of the temporal framework and the R-tree ctypes bindings that no test in CI covered. The cases build their datasets in memory, so they need neither a temporal database nor a GRASS session. - grass_temporal_datetime_math_test.py: datetime increment by string and adjustment of a datetime to a granularity. - grass_temporal_granularity_test.py: absolute-time granularity of map lists of intervals, time points and a mix of both. - grass_temporal_topology_test.py: the temporal topology builder relations (overlaps, overlapped, follows, precedes, contains, during) and the map list sorting keys. Following TemporalExtent.overlaps, an interval that starts and ends earlier overlaps the later one. - grass_temporal_spatial_extent_test.py: the 2D and 3D spatial extent relations and intersection. - lib_vector_rtree_ctypes_test.py: the 1D to 4D R-tree search through the grass.lib ctypes bindings. These checks previously existed only in grass.temporal.unit_tests, which could not be imported and was not run, and in doctests that CI does not execute. Prepared with the assistance of AI (Claude Code).
The module has been unimportable since the star imports were removed in 0c83c97: it imports adjust_datetime_to_granularity from temporal_granularity, but that function lives in datetime_math. Nothing imports the module, no test runner collects it (it is neither a pytest tests/ file nor a gunittest testsuite/ file), and its own docstring calls it deprecated, so the breakage went unnoticed for years. Sphinx autodoc does reach it and reports the failed import as a warning. Repairing it would mean more than fixing the import. Two assertions in test_temporal_topology_builder expect the inverse of the current overlaps/overlapped semantics and fail once the module can be imported again, and the four rtree functions assert nothing at all, they only print. The checks that remain are already covered by doctests in datetime_math, temporal_granularity, spatial_extent and spatio_temporal_relationships; the adjust_datetime_to_granularity doctests are the same eleven cases the module used. Remove the module instead of resurrecting a test nothing runs. Drop it from the Makefile module list so it is no longer installed, and drop the pytest ignore that only existed to step around it. The investigation and the change were done with the help of AI (Claude Code).
wenzeslaus
force-pushed
the
temporal-unit-tests-pytest-port
branch
from
July 16, 2026 08:42
126eb99 to
b353096
Compare
wenzeslaus
marked this pull request as ready for review
July 16, 2026 12:34
petrasovaa
approved these changes
Jul 16, 2026
wenzeslaus
enabled auto-merge (squash)
July 16, 2026 15:15
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.
Add executed pytest tests for parts of the temporal framework and the
R-tree ctypes bindings that no test in CI covered. The cases build their
datasets in memory, so they need neither a temporal database nor a GRASS
session.
Details
- grass_temporal_datetime_math_test.py: datetime increment by string and adjustment of a datetime to a granularity. - grass_temporal_granularity_test.py: absolute-time granularity of map lists of intervals, time points and a mix of both. - grass_temporal_topology_test.py: the temporal topology builder relations (overlaps, overlapped, follows, precedes, contains, during) and the map list sorting keys. Following TemporalExtent.overlaps, an interval that starts and ends earlier overlaps the later one. - grass_temporal_spatial_extent_test.py: the 2D and 3D spatial extent relations and intersection. - lib_vector_rtree_ctypes_test.py: the 1D to 4D R-tree search through the grass.lib ctypes bindings.These checks previously existed only in grass.temporal.unit_tests, which
could not be imported and was not run, and in doctests that CI does not
execute.
The dead grass.temporal.unit_tests module, its Makefile entry, and the
pytest --ignore that skipped it are removed.
The module has been unimportable since the star imports were removed in
0c83c97: it imports adjust_datetime_to_granularity from
temporal_granularity, but that function lives in datetime_math. Nothing
imports the module, no test runner collects it (it is neither a pytest
tests/ file nor a gunittest testsuite/ file), and its own docstring calls
it deprecated, so the breakage went unnoticed for years. Sphinx autodoc
does reach it and reports the failed import as a warning. Remove the module
instead of resurrecting a test nothing runs.
Prepared with the assistance of AI (Claude Code).