Skip to content

CI(g.list): migrate tests to pytest#7227

Open
Khansa435 wants to merge 4 commits intoOSGeo:mainfrom
Khansa435:g-list-tests-clean
Open

CI(g.list): migrate tests to pytest#7227
Khansa435 wants to merge 4 commits intoOSGeo:mainfrom
Khansa435:g-list-tests-clean

Conversation

@Khansa435
Copy link
Copy Markdown

@Khansa435 Khansa435 commented Mar 27, 2026

Description

This PR migrates the legacy GMlistWrongParamertersTest from the grass.gunittest framework to the modern pytest framework for the g.list module.

Key Changes:

  • Migrated parameter validation tests (mutually exclusive flags) to general/g.list/tests/g_list_test.py.
  • Used pytest.mark.parametrize for clean, data-driven test cases.
  • Implemented explicit error verification using pytest.raises(CalledModuleError).
  • Added a new test case for invalid format and flags combinations.
  • Cleaned up syntax and ensured compatibility with the existing simple_dataset fixture.

Related Issue

Fixes #7226

Automated Tests

  • Verified using a local standalone script that replicates the CalledModuleError catching on Windows (OSGeo4W).
  • The migrated code follows the pattern of existing tests in the g.list suite to ensure CI compatibility.

Manual Verification

  • Verified that the g.list module correctly identifies and reports mutually exclusive flags (-p, -t, -f, etc.) within the new test structure.

@github-actions github-actions bot added Python Related code is in Python module general tests Related to Test Suite labels Mar 27, 2026
@Khansa435 Khansa435 changed the title test(g.list): migrate to pytest CI(g.list): migrate tests to pytest Mar 27, 2026
@wenzeslaus
Copy link
Copy Markdown
Member

This is generated without AI or human looking at any existing tests. Also, migrate would generally mean remove the old stuff.

Khansa435 and others added 3 commits March 29, 2026 03:56
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

Migrate g.list parameter validation tests from gunittest to pytest

2 participants