Skip to content

r.in.ascii: migrate tests from gunittest to pytest - #7780

Merged
petrasovaa merged 7 commits into
OSGeo:mainfrom
Valyrian-Code:r.in.ascii-pytest
Sep 23, 2026
Merged

petrasovaa merged 7 commits into
OSGeo:mainfrom
Valyrian-Code:r.in.ascii-pytest

Conversation

@Valyrian-Code

Copy link
Copy Markdown
Contributor

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.

Copilot AI review requested due to automatic review settings July 26, 2026 13:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added raster Related to raster data processing Python Related code is in Python module tests Related to Test Suite labels Jul 26, 2026
echoix
echoix previously requested changes Jul 27, 2026
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.
@Valyrian-Code

Copy link
Copy Markdown
Contributor Author

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.

@Valyrian-Code

Copy link
Copy Markdown
Contributor Author

Added the SPDX-License-Identifier header here too, same tip from #7822.

@echoix echoix added the conflicts/needs rebase Rebase to or merge with the latest base branch is needed label Sep 5, 2026
@echoix

echoix commented Sep 5, 2026

Copy link
Copy Markdown
Member

Could you please solve conflicts?

# Conflicts:
#	raster/r.in.ascii/testsuite/test_r_in_ascii.py
@Valyrian-Code

Copy link
Copy Markdown
Contributor Author

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.

@Valyrian-Code

Copy link
Copy Markdown
Contributor Author

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.

@Valyrian-Code

Copy link
Copy Markdown
Contributor Author

All green and both threads resolved since your last look. Re-review when you can?

@petrasovaa petrasovaa removed the conflicts/needs rebase Rebase to or merge with the latest base branch is needed label Sep 23, 2026
Co-authored-by: Anna Petrasova <kratochanna@gmail.com>
@petrasovaa
petrasovaa enabled auto-merge (squash) September 23, 2026 02:15
@petrasovaa
petrasovaa merged commit 2d31720 into OSGeo:main Sep 23, 2026
26 checks passed
@github-actions github-actions Bot added this to the 8.6.0 milestone Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module Python Related code is in Python raster Related to raster data processing tests Related to Test Suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants