Skip to content

fix: correct multiple typos in test files#8851

Open
vikasreddy11 wants to merge 3 commits into
Project-MONAI:devfrom
vikasreddy11:fix/typo
Open

fix: correct multiple typos in test files#8851
vikasreddy11 wants to merge 3 commits into
Project-MONAI:devfrom
vikasreddy11:fix/typo

Conversation

@vikasreddy11
Copy link
Copy Markdown

@vikasreddy11 vikasreddy11 commented May 12, 2026

Fixes # .
Fixed the following typos in test files:

  • empyempty in tests/utils/test_look_up_option.py
  • resulstresults in tests/utils/test_profiling.py
  • specficspecific in tests/networks/utils/test_replace_module.py

Description

A few sentences describing the changes proposed in this pull request.

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Breaking change (fix or new feature that would cause existing functionality to change).
  • New tests added to cover the changes.
  • Integration tests passed locally by running ./runtests.sh -f -u --net --coverage.
  • Quick tests passed locally by running ./runtests.sh --quick --unittests --disttests.
  • In-line docstrings updated.
  • Documentation updated, tested make html command in the docs/ folder.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 12, 2026

📝 Walkthrough

Walkthrough

Three test-only edits: in tests/utils/test_look_up_option.py the test_no_found call was changed from look_up_option("empy", _CaseEnum) to look_up_option("empty", _CaseEnum) to match the assertion's regex; in tests/utils/test_profiling.py a docstring typo was fixed from "resulst" to "results"; in tests/networks/utils/test_replace_module.py an inline comment spelling was corrected from "specfic" to "specific". No functional code or public API changes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title accurately summarizes the main change: correcting multiple typos across test files, matching the changeset content.
Description check ✅ Passed PR description follows the template with clear enumeration of typo fixes, proper checkbox selections, and adequate context.

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

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

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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 and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/utils/test_look_up_option.py`:
- Around line 74-75: The test was changed to use the valid enum string "empty"
which makes look_up_option("empty", _CaseEnum) succeed instead of triggering the
suggestion error; revert the argument back to the intentional typo "empy" so the
test verifies look_up_option's error/suggestion behavior for near-miss values
(refer to look_up_option and _CaseEnum in the test).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: eb087bad-c364-415d-b115-bac86cb5d994

📥 Commits

Reviewing files that changed from the base of the PR and between 586dea1 and 816880e.

📒 Files selected for processing (1)
  • tests/utils/test_look_up_option.py

Comment on lines 74 to +75
with self.assertRaisesRegex(ValueError, "did.*empty"):
look_up_option("empy", _CaseEnum)
look_up_option("empty", _CaseEnum)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify that "empty" is a valid lookup and "empy" triggers suggestion

# Check if the test file exists and look for the contradiction
rg -n "empty.*_CaseEnum.*EMPTY" tests/utils/test_look_up_option.py

# Show the test_no_found context
rg -A 2 -B 2 "did\.\*empty" tests/utils/test_look_up_option.py

Repository: Project-MONAI/MONAI

Length of output: 404


Revert to intentional typo "empy".

Line 42 shows "empty" is a valid enum value that returns _CaseEnum.EMPTY. Changing line 75 to the same value contradicts the test expectation: it will succeed instead of raising ValueError. The original "empy" was a near-miss spelling to test the error suggestion logic.

-            look_up_option("empty", _CaseEnum)
+            look_up_option("empy", _CaseEnum)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
with self.assertRaisesRegex(ValueError, "did.*empty"):
look_up_option("empy", _CaseEnum)
look_up_option("empty", _CaseEnum)
with self.assertRaisesRegex(ValueError, "did.*empty"):
look_up_option("empy", _CaseEnum)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/utils/test_look_up_option.py` around lines 74 - 75, The test was
changed to use the valid enum string "empty" which makes look_up_option("empty",
_CaseEnum) succeed instead of triggering the suggestion error; revert the
argument back to the intentional typo "empy" so the test verifies
look_up_option's error/suggestion behavior for near-miss values (refer to
look_up_option and _CaseEnum in the test).

@vikasreddy11 vikasreddy11 changed the title fix: correct typo empy -> empty in test_look_up_option.py fix: correct multiple typos in test files May 12, 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.

1 participant