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

Refactor test cases to improve unit test quality #18303

Merged
merged 2 commits into from
Jul 31, 2023

Conversation

freddiewanah
Copy link
Contributor

Hello, first-time submitting PR here. I've read through the contributor guide and figured it's a minor update, hence this PR.

This PR improves the readability of the assert statements in some of the unit tests by using more expressive assert methods from the unittest module. These changes improve code quality (avoid test smells) by:

  • Making the assert statements more readable and consistent with other asserts in the same test file, i.e., assertLen.

Happy to update more related issues in the test code if needed :)

@google-cla
Copy link

google-cla bot commented Jul 23, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gbaned gbaned requested a review from mattdangerw July 24, 2023 05:45
@gbaned gbaned added the keras-team-review-pending Pending review by a Keras team member. label Jul 24, 2023
Copy link
Member

@grasskin grasskin 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, thank you for the PR! Test changes look good.

@google-ml-butler google-ml-butler bot added kokoro:force-run ready to pull Ready to be merged into the codebase labels Jul 27, 2023
@grasskin grasskin removed the keras-team-review-pending Pending review by a Keras team member. label Jul 27, 2023
copybara-service bot pushed a commit that referenced this pull request Jul 28, 2023
Imported from GitHub PR #18303

Hello, first-time submitting PR here. I've read through the contributor guide and figured it's a minor update, hence this PR.

This PR improves the readability of the assert statements in some of the unit tests by using more expressive assert methods from the unittest module. These changes improve code quality (avoid test smells) by:

- Making the assert statements more readable and consistent with other asserts in the same test file, i.e., assertLen.

Happy to update more related issues in the test code if needed :)
Copybara import of the project:

--
d823be2 by freddiewanah <[email protected]>:

Refactor test cases to improve unit test quality

--
ddeff03 by freddiewanah <[email protected]>:

revert assertRaisesRegex

Merging this change closes #18303

FUTURE_COPYBARA_INTEGRATE_REVIEW=#18303 from freddiewanah:master ddeff03
PiperOrigin-RevId: 551893138
@gbaned gbaned added ready to pull Ready to be merged into the codebase and removed ready to pull Ready to be merged into the codebase awaiting review labels Jul 31, 2023
copybara-service bot pushed a commit that referenced this pull request Jul 31, 2023
Imported from GitHub PR #18303

Hello, first-time submitting PR here. I've read through the contributor guide and figured it's a minor update, hence this PR.

This PR improves the readability of the assert statements in some of the unit tests by using more expressive assert methods from the unittest module. These changes improve code quality (avoid test smells) by:

- Making the assert statements more readable and consistent with other asserts in the same test file, i.e., assertLen.

Happy to update more related issues in the test code if needed :)
Copybara import of the project:

--
d823be2 by freddiewanah <[email protected]>:

Refactor test cases to improve unit test quality

--
ddeff03 by freddiewanah <[email protected]>:

revert assertRaisesRegex

Merging this change closes #18303

FUTURE_COPYBARA_INTEGRATE_REVIEW=#18303 from freddiewanah:master ddeff03
PiperOrigin-RevId: 551893138
@copybara-service copybara-service bot merged commit efbe517 into keras-team:master Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to pull Ready to be merged into the codebase size:S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants