tests: add live integration test for get_region in grass.jupyter#7198
Closed
AkshadSonawane wants to merge 1 commit intoOSGeo:mainfrom
Closed
tests: add live integration test for get_region in grass.jupyter#7198AkshadSonawane wants to merge 1 commit intoOSGeo:mainfrom
AkshadSonawane wants to merge 1 commit intoOSGeo:mainfrom
Conversation
dd7471f to
ae8ad2c
Compare
Contributor
|
GRASS pytests assume PYTHONPATH is already set up, just look how most pytests in GRASS look like. Also, please test locally, don't rely on CI. |
Author
Thanks for the feedback, @petrasovaa! I've dropped the subprocess approach, switched to using the native session fixture from conftest.py, and verified everything locally this time. Updated tests are over at #7209. |
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.
Hi! Following up on the feedback from #7180, I've completely rewritten these tests to drop the mocks and use a live GRASS session instead.
The new tests borrow the run_in_subprocess pattern from test_init_finish to spin up a live temporary project in isolation. They check that get_region() returns the expected geographic keys (n, s, e, w, nsres, ewres), and use abs() < 1e-6 for the float comparisons when verifying the dict reflects a g.region change. Tests are marked @pytest.mark.integration so they won't run unless explicitly called with pytest -m integration.
Verified the Python logic locally - full integration needs a compiled GRASS environment so leaning on CI for the live-session check, same as the existing test_init_finish tests do.