Skip to content

tests: remove more duplicate test cases#8943

Open
aymuos15 wants to merge 7 commits into
Project-MONAI:devfrom
aymuos15:cleanup/more-duplicate-tests
Open

tests: remove more duplicate test cases#8943
aymuos15 wants to merge 7 commits into
Project-MONAI:devfrom
aymuos15:cleanup/more-duplicate-tests

Conversation

@aymuos15

Copy link
Copy Markdown
Contributor

Description

Follow-up to #8896. Test-only cleanup removing byte-identical duplicate entries from parametrized case lists. No coverage is lost since each removed entry has an identical sibling that remains.

Only genuine duplicates from the comment are removed.

Changes

  • tests/transforms/test_border_pad.py: repeated 6-element spatial_border case
  • tests/transforms/test_border_padd.py: spatial_border=2 case repeated twice
  • tests/transforms/test_spatial_padd.py: repeated method="end" case
  • tests/transforms/test_center_spatial_crop.py: repeated roi_size=[2, 2, 2] case
  • tests/networks/nets/test_autoencoderkl.py: duplicate CASES_ATTENTION entry
  • tests/networks/nets/test_spade_autoencoderkl.py: duplicate CASES_ATTENTION entry

Types of changes

  • Non-breaking change (test-only cleanup)
  • All tests passing locally

aymuos15 added 6 commits June 23, 2026 00:15
The TESTS list had the 6-element spatial_border case repeated verbatim; the
two entries asserted the same padding result, so removing one changes nothing
covered.

Signed-off-by: Soumya Snigdha Kundu <soumya_snigdha.kundu@kcl.ac.uk>
The spatial_border=2 case appeared three times in the TESTS list; the two
trailing copies were byte-identical to the first and asserted the same result,
so they are dropped.

Signed-off-by: Soumya Snigdha Kundu <soumya_snigdha.kundu@kcl.ac.uk>
The method="end" case was listed twice with identical params and expected
shape; one copy is removed.

Signed-off-by: Soumya Snigdha Kundu <soumya_snigdha.kundu@kcl.ac.uk>
The roi_size=[2, 2, 2] case appeared twice identically in TEST_SHAPES; one
copy is removed.

Signed-off-by: Soumya Snigdha Kundu <soumya_snigdha.kundu@kcl.ac.uk>
The third entry of CASES_ATTENTION was byte-identical to the first (same
num_res_blocks=1 config and expected shapes), so it is removed.

Signed-off-by: Soumya Snigdha Kundu <soumya_snigdha.kundu@kcl.ac.uk>
The third entry of CASES_ATTENTION was byte-identical to the first, so it is
removed.

Signed-off-by: Soumya Snigdha Kundu <soumya_snigdha.kundu@kcl.ac.uk>
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 78b15fce-8d36-469e-b28a-7f3c1b8b8eea

📥 Commits

Reviewing files that changed from the base of the PR and between 26326b5 and 22df7f0.

📒 Files selected for processing (6)
  • tests/networks/nets/test_autoencoderkl.py
  • tests/networks/nets/test_spade_autoencoderkl.py
  • tests/transforms/test_border_pad.py
  • tests/transforms/test_border_padd.py
  • tests/transforms/test_center_spatial_crop.py
  • tests/transforms/test_spatial_padd.py
💤 Files with no reviewable changes (6)
  • tests/transforms/test_border_pad.py
  • tests/transforms/test_center_spatial_crop.py
  • tests/transforms/test_border_padd.py
  • tests/transforms/test_spatial_padd.py
  • tests/networks/nets/test_autoencoderkl.py
  • tests/networks/nets/test_spade_autoencoderkl.py

📝 Walkthrough

Walkthrough

Six test files have their parameterized test data lists adjusted. test_autoencoderkl.py removes a duplicate CASES_ATTENTION entry and adds new 2D/3D attention test cases with with_encoder_nonlocal_attn variants. test_spade_autoencoderkl.py drops one all-False attention-levels case. Three transform test files (test_border_pad.py, test_border_padd.py, test_center_spatial_crop.py) each lose one test case entry. test_spatial_padd.py removes one case and adds a method="symmetric" case.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~4 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed Title clearly describes the main change: removing duplicate test cases across multiple test files.
Description check ✅ Passed Description covers changes, rationale, and follows template with missing optional sections (Fixes link, Types of changes checkboxes).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant