Skip to content

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

Open
Valyrian-Code wants to merge 1 commit 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 1 commit 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 on lines +9 to +26
INPUT_EXPLICIT_NULL = """north: 4299000.00
south: 4247000.00
east: 528000.00
west: 500000.00
rows: 10
cols: 15
null: -9999

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8 9 10 11 12 13 -9999 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 -9999
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15"""

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This isn't the same as the previously checked value.

Comment on lines +28 to +40
INPUT_DEFAULT_NULL = """north: 220542
south: 220528
east: 638492
west: 638478
rows: 7
cols: 7
3 2 5 3 5 3 4
1 4 5 5 5 * 4
2 1 * 3 5 5 2
4 2 4 4 4 5 4
4 4 2 * 5 2 4
1 2 1 1 2 2 2
5 4 1 2 3 4 2"""

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Make sure that even the line endings are the same from what was there before.

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