Tests: add pytest-based test for rasterExists helper function#7171
Tests: add pytest-based test for rasterExists helper function#7171ayushjariyal wants to merge 19 commits intoOSGeo:mainfrom
Conversation
63be943 to
7df831d
Compare
|
While working on the pytest conversion, I organized the related utilities into a new directory However, the CI checks are currently failing with the following error:
It seems that the new subpackage may not be included in the installed GRASS Python package used in CI. Before proceeding further, I wanted to confirm whether introducing a separate submodule like If the separate submodule approach is acceptable, could you please suggest what changes might be needed so that I would like to follow the structure that fits best with the project. |
|
Most probably the makefiles and CMakeLists need to be adjusted in consequence. Look for the closest ones up in the folder hierarchy |
b96c294 to
6423f48
Compare
|
@echoix, @petrasovaa , Now all the checks are passed. Could you please review it now? |
wenzeslaus
left a comment
There was a problem hiding this comment.
This is a lot of code for what are basically two lines of new code. Yes, something like special set of functions to aid pytest might be needed, but let's think about this first: Raster existence check goes beyond pytest-based testing. Where it can live instead? Can the grass.gunittest code use such a function?
This is also a lot of noise compared to the resulting code. While the current code has some merit, it is nowhere close to being merged.
72d20aa to
a379acc
Compare
|
@wenzeslaus , Thanks for the feedback! I’ve updated the helper to behave as a proper pytest-style assertion by raising AssertionError instead of returning a boolean. I also renamed it to raster_exists to follow snake_case conventions. |
e53d8a4 to
b9572ad
Compare
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
b9572ad to
069f8b7
Compare
This PR introduces a pytest-based test for rasterExists and a fixture for automatic GRASS session setup.
Changes:
Testing:
GSoC 2026:
This contribution is a part of GSoC 2026 Support writing tests with pytest project.