Skip to content

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

Open
Valyrian-Code wants to merge 3 commits into
OSGeo:mainfrom
Valyrian-Code:r.in.ascii-pytest
Open

r.in.ascii: migrate tests from gunittest to pytest#7780
Valyrian-Code wants to merge 3 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
Comment thread raster/r.in.ascii/tests/r_in_ascii_test.py Outdated
Comment thread raster/r.in.ascii/tests/r_in_ascii_test.py Outdated
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.

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.

3 participants