Skip to content

grass.temporal: Remove duplicate test and fix copy-pasted docstrings in granularity tests - #733

Closed
echoix wants to merge 3 commits into
mainfrom
fix/temporal-remove-duplicate-test
Closed

echoix wants to merge 3 commits into
mainfrom
fix/temporal-remove-duplicate-test

Conversation

@echoix

@echoix echoix commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner

Description

unittests_temporal_algebra_grs.py defined test_common_granularity_4 twice with identical bodies. Python keeps only the last definition, so the first copy never ran as a separate test. This PR removes the duplicate copy. The remaining test checks the same assertions as before, so no test coverage is lost.

The docstrings of test_common_granularity_5 and test_common_granularity_6 were copied from test_common_granularity_4 ("year to month with gaps") and did not describe what those tests do. They now describe the three-dataset expression and the conditional expression, respectively.

Motivation and context

The duplicate was found by ruff's F811 (redefined-while-unused) check.

How has this been tested?

Compared the two bodies in the git history; they are identical, including the docstring. The docstring change does not affect behavior. ruff check and ruff format --check pass on the file.

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.

This change was prepared with the help of Claude Code.

@echoix echoix changed the title grass.temporal: Remove duplicate test_common_granularity_4 grass.temporal: Remove duplicate test and fix copy-pasted docstrings in granularity tests Oct 10, 2026
github-actions Bot and others added 3 commits October 10, 2026 15:40
The second definition of test_common_granularity_4 was an identical
copy of the first. Python keeps only the last definition, so the first
one never ran as a separate test. Remove the copy; the remaining test
checks the same thing.

The change was found and fixed with AI assistance.
@echoix
echoix force-pushed the fix/temporal-remove-duplicate-test branch from 5ccf47e to 06e64f9 Compare October 10, 2026 19:52
@echoix echoix closed this Oct 11, 2026
@echoix
echoix deleted the fix/temporal-remove-duplicate-test branch October 11, 2026 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants