Skip to content

grass.pygrass: Load the grid doctests in the grid wrapper - #746

Open
echoix wants to merge 2 commits into
pygrass-doctests-gunittestfrom
pygrass-grid-doctests
Open

echoix wants to merge 2 commits into
pygrass-doctests-gunittestfrom
pygrass-grid-doctests

Conversation

@echoix

@echoix echoix commented Oct 14, 2026

Copy link
Copy Markdown
Owner

Description

Builds on #744 (this PR is based on that branch, so only the last commit is new).

The doctest wrapper in pygrass/modules/grid/testsuite loaded no tests: it was a copy of the one for shortcuts with its only addTests() call commented out. The doctests of the grid module were run by the wrapper in pygrass/modules/testsuite instead.

  • Load the doctests of grid, patch and split in the grid wrapper.
  • Remove the wrapper in pygrass/modules/testsuite. After the move it loaded only the interface package, which has no doctests (its modules are loaded by pygrass/modules/interface/testsuite), and remove its entry in the ruff per-file ignores.

Motivation and context

A wrapper that reports Ran 0 tests and passes hides that nothing is tested, and the grid doctests were in an unrelated place.

How has this been tested?

python3 -m grass.gunittest.main --location-type nc --config .gunittest.cfg with nc_spm_full_v2beta1 on python/grass/pygrass/modules: all 6 files pass, and the grid wrapper now runs the same 6 doctests as before. ruff check and ruff format --check pass.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing
    functionality to not work as before)

Checklist

  • PR title provides summary of the changes and starts with one of the
    pre-defined prefixes
  • My code follows the code style
    of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

The changes were developed with the help of an AI assistant (Claude).


Generated by Claude Code

The doctest wrapper in pygrass/modules/grid/testsuite loaded no tests.
It was a copy of the one for shortcuts with the only addTests() call
commented out. The doctests of the grid module were run by the wrapper
in pygrass/modules/testsuite instead.

Load the doctests of grid, patch and split in the grid wrapper. The
wrapper in pygrass/modules/testsuite then loaded only the interface
package, which has no doctests (its modules are loaded by the wrapper in
pygrass/modules/interface/testsuite), so remove it.

The changes were developed with the help of an AI assistant (Claude).
@echoix echoix changed the title pygrass: Load the grid doctests in the grid wrapper grass.pygrass: Load the grid doctests in the grid wrapper Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants