-
-
Notifications
You must be signed in to change notification settings - Fork 425
Migrate g.list parameter validation tests from gunittest to pytest #7226
Copy link
Copy link
Open
Description
Problem Description
The GRASS GIS project is currently in the process of migrating its testing framework from the legacy grass.gunittest (based on Python's unittest) to the modern pytest framework.
Currently, many core modules still have their validation logic tests residing in the legacy testsuite/ directories. Specifically, the g.list module has several critical parameter validation tests (such as checking for mutually exclusive flags) that have not yet been migrated to the modern tests/ directory.
Rationale
Migrating these tests to pytest is necessary because:
- Maintainability: The
gunittestframework involves significant boilerplate and is harder to maintain than plainpytestfunctions. - Modern Tooling:
pytestallows for powerful features like parametrization, which would significantly simplify the testing of multiple flag and parameter combinations forg.list. - Consistency: Moving all tests to the tests/ directory provides a unified testing interface for the entire repository.
Expectations
- The logic within GMlistWrongParamertersTest (found in general/g.list/testsuite/test_g_list.py) should be ported to a
pytest-compatible format. - The new tests should be integrated into general/g.list/tests/g_list_test.py.
- Validation should utilize modern
pytestfeatures, such as@pytest.mark.parametrizefor flag combinations andpytest.raisesfor error handling. - The migrated tests must be verified to pass in standard environments, including Windows (OSGeo4W).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels