Skip to content

g.remove: migrate tests from gunittest to pytest - #7896

Draft
Valyrian-Code wants to merge 2 commits into
OSGeo:mainfrom
Valyrian-Code:g.remove-pytest
Draft

g.remove: migrate tests from gunittest to pytest#7896
Valyrian-Code wants to merge 2 commits into
OSGeo:mainfrom
Valyrian-Code:g.remove-pytest

Conversation

@Valyrian-Code

Copy link
Copy Markdown
Contributor

Migrates the g.remove testsuite from gunittest to pytest, continuing the one-at-a-time migrations from #7635/#7675/#7780/#7893/#7894.

Same three cases as before: the dry-run listing versus -f actually removing and logging each removal to stderr, the exclude= option, and the -r/-e mutual exclusivity check.

One small change on that last one: the old test just checked that "-r" and "-e" both appear somewhere in the error output, which is true even for an unrelated error, since the full usage text always lists both flags. This checks the specific "mutually exclusive" message instead.

Verified locally, all three pass.

@echoix

echoix commented Sep 5, 2026

Copy link
Copy Markdown
Member

One small change on that last one: the old test just checked that "-r" and "-e" both appear somewhere in the error output, which is true even for an unrelated error, since the full usage text always lists both flags. This checks the specific "mutually exclusive" message instead.

Good :)

@github-actions github-actions Bot added Python Related code is in Python module general tests Related to Test Suite labels Sep 5, 2026

@ninsbl ninsbl left a comment

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.

THe number of maps in the test may be reduced, but the test is rewritten from the original unittest 1:1. So, OK for me to merge anyway, as the tiny maps do not have a very significant input on run time, but things accumulate...

Comment thread general/g.remove/tests/g_remove_test.py
Comment thread general/g.remove/tests/g_remove_test.py
@Valyrian-Code

Copy link
Copy Markdown
Contributor Author

Thanks for approving. Fair point on the map count, I kept it 1:1 with the original gunittest for a faithful migration, but fewer would work just as well here. Will use smaller counts going forward where the original test's exact number was not itself the point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

general module Python Related code is in Python tests Related to Test Suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants