Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge similar test components with parameterized #7663

Merged
merged 8 commits into from
Apr 23, 2024

Conversation

freddiewanah
Copy link
Contributor

@freddiewanah freddiewanah commented Apr 18, 2024

Description

I noticed some test cases contain same duplicated asserts. Having multiple asserts in one test cases can cause potential issues like when the first assert fails, the test case stops and won't check the second assert. By using @parameterized.expand, this issue can be resolved and the caching also saves execution time.

Added sign-offs from #7648

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.

Copy link
Contributor

@KumoLiu KumoLiu left a comment

Choose a reason for hiding this comment

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

Hi @freddiewanah, appreciate your contribution with the PR! Your work has indeed boosted the legibility of the testing code. I've made a few further improvement suggestions directly within the code. Thank you.

tests/test_affine_transform.py Outdated Show resolved Hide resolved
tests/test_compute_f_beta.py Outdated Show resolved Hide resolved
tests/test_compute_f_beta.py Outdated Show resolved Hide resolved
tests/test_global_mutual_information_loss.py Outdated Show resolved Hide resolved
tests/test_median_filter.py Outdated Show resolved Hide resolved
@KumoLiu
Copy link
Contributor

KumoLiu commented Apr 19, 2024

Please take a look at the ci error looks forget name arg.
https://github.com/Project-MONAI/MONAI/actions/runs/8752234621/job/24019446729?pr=7663#step:12:19220

Thanks.

Signed-off-by: Han Wang <[email protected]>
@freddiewanah
Copy link
Contributor Author

Hi KumoLiu, thanks for the review, I've updated the code and now the error is fixed :)

@KumoLiu
Copy link
Contributor

KumoLiu commented Apr 19, 2024

/build

@KumoLiu
Copy link
Contributor

KumoLiu commented Apr 23, 2024

/build

Copy link
Contributor

@KumoLiu KumoLiu left a comment

Choose a reason for hiding this comment

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

Thanks for the quick update!

@KumoLiu KumoLiu merged commit ec6aa33 into Project-MONAI:dev Apr 23, 2024
28 checks passed
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