Skip to content

tests: add live integration test for get_region in grass.jupyter#7198

Closed
AkshadSonawane wants to merge 1 commit intoOSGeo:mainfrom
AkshadSonawane:jupyter-integration-test
Closed

tests: add live integration test for get_region in grass.jupyter#7198
AkshadSonawane wants to merge 1 commit intoOSGeo:mainfrom
AkshadSonawane:jupyter-integration-test

Conversation

@AkshadSonawane
Copy link
Copy Markdown

@AkshadSonawane AkshadSonawane commented Mar 19, 2026

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.

@AkshadSonawane AkshadSonawane changed the title Jupyter integration test tests: add live integration test for get_region in grass.jupyter Mar 19, 2026
@github-actions github-actions bot added Python Related code is in Python libraries notebook labels Mar 19, 2026
@AkshadSonawane AkshadSonawane force-pushed the jupyter-integration-test branch from dd7471f to ae8ad2c Compare March 21, 2026 20:44
@github-actions github-actions bot added the tests Related to Test Suite label Mar 21, 2026
@petrasovaa
Copy link
Copy Markdown
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.

@AkshadSonawane
Copy link
Copy Markdown
Author

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.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

libraries notebook Python Related code is in Python tests Related to Test Suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants