tests: add pytest for get_region in grass.jupyter#7180
Open
AkshadSonawane wants to merge 5 commits intoOSGeo:mainfrom
Open
tests: add pytest for get_region in grass.jupyter#7180AkshadSonawane wants to merge 5 commits intoOSGeo:mainfrom
AkshadSonawane wants to merge 5 commits intoOSGeo:mainfrom
Conversation
fef7f9d to
95b05e3
Compare
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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 unit test for 'get_region' in Jupyter utils
1. What I Did & Why :
Hey everyone! This PR adds a quick unit test for the 'get_region' function over in 'grass.jupyter.utils'.
To keep the tests fast and avoid needing a live GRASS session, I used 'pytest' and 'unittest.mock.patch' to mock the 'Tools' class. This simulates 'g.region' returning some dummy data. It basically just verifies that the utility is correctly parsing the geographic data into a standard Python dictionary.
Mainly doing this to help improve the test coverage for the Python toolset!
2. Results :
Everything isolates properly and passes cleanly on my end without errors.
OUTPUT:
3. Intention :
On a personal note, I'm submitting this as part of my preparation for GSoC 2026. I'm aiming for the "Improve GRASS user experience in Jupyter Notebook" project. Since I'm focusing my core contributions around Python and data science libraries, I'd absolutely love any feedback from the maintainers on my testing approach here. I just want to make sure my code aligns with the project's standards before I put my final proposal together. Thanks!