Repository navigation
r.null: migrate tests from gunittest to pytest - #7675
Conversation
wenzeslaus
left a comment
There was a problem hiding this comment.
Minor polish: setnull and null accept numbers, which reads a bit more naturally in Python than the string form.
Co-authored-by: Vaclav Petras <wenzeslaus@gmail.com>
Co-authored-by: Vaclav Petras <wenzeslaus@gmail.com>
Co-authored-by: Vaclav Petras <wenzeslaus@gmail.com>
|
wenzeslaus
left a comment
There was a problem hiding this comment.
Great. Thanks. Next time, try hard to criticize the changes before posting.
Here specifically, I don't recall reason for the null values to be passed as strings, but the underlying mechanism is different (SimpleModule vs Tools), so there was a reason to rethink and update.
|
Fair point, the strings were carried over from the old test without a second thought. Changed to plain numbers now. Will look harder at these next time. |
|
Thanks. Next time, it would good to also have a commit message ready to go, i.e. updated to correspond to the PR. We squash, so PR description is the right place (can be separate section or the desc itself). (None needed now, I already enabled automerge.) |
|
Got it, I will keep the PR description in a squash ready form from now on. Thanks for enabling automerge. |
Migrates the r.null testsuite from gunittest to pytest. Everything goes through grass.tools (r.describe results read with .json, no gs.parse_command). The three checks from the old testsuite are preserved: setnull on an integer map with -i, setnull on a floating point map with -f, and filling NULL cells with the null parameter.
Migrates the r.null testsuite from gunittest to pytest, following the r.cross migration (#7635) as suggested there. Same shape: small, isolated, and the tests create their own data, so no test dataset is needed.
The review feedback from #7635 is applied here from the start: everything goes through grass.tools (r.describe results read with .json, no gs.parse_command or env plumbing) and there is no overwrite=True, since the function-scoped fixture gives every test a fresh project.
The three checks from the old testsuite are preserved: setnull on an integer map with -i, setnull on a floating point map with -f, and filling NULL cells with null=. All three pass locally.