r.in.ascii: migrate tests from gunittest to pytest - #7780
Conversation
Restore the original stdin data (all cells 1..15, no NULLs, so min=1/max=15) instead of injecting -9999 values, and keep the external-file content byte-identical including its trailing newline. Assert the null-cell counts the data actually produces: 0 for the null= header that matches no cell, 3 for the * default-null character.
|
Thanks @echoix, addressed both: restored the original stdin data (no injected -9999, so it checks min and max exactly as before) and kept the file content byte-identical including the trailing newline. Verified locally, both tests pass. |
|
Added the SPDX-License-Identifier header here too, same tip from #7822. |
|
Could you please solve conflicts? |
# Conflicts: # raster/r.in.ascii/testsuite/test_r_in_ascii.py
|
Resolved, thanks. The conflict was the SPDX header update from #7756 landing on the old testsuite file this PR removes, kept the removal since that file is replaced by the new pytest one. |
|
Heads-up: the two failing checks (Python Code Quality Checks and the ubuntu 24.04 db/display/... job) both failed within about a minute and a half, during dependency setup, not the actual test run. The log shows add-apt-repository failing to add the ubuntugis-unstable PPA with an HTTP 504 from Launchpad's signing-key server, which is why the next step also fails with "grass: command not found", GRASS was never installed. Every other check, including both pytest jobs, passed. Looks like a transient infra issue rather than anything in this PR. Happy to push an empty commit if that helps trigger a fresh run, otherwise a re-run should clear it. |
Migrates the r.in.ascii testsuite from gunittest to pytest, continuing the one-at-a-time migrations from #7635/#7675.
Both tests use io.StringIO for input instead of stdin or an external file. The null-value test previously never included an actual null value in its data, so it only checked that the header parsed; it now injects two -9999 cells and asserts null_cells == 2. The default-null-character test keeps its original intent (a bare * marks a cell NULL) and its null_cells == 3 check.
Verified locally, both tests pass.