Skip to content

Replace try-catch constructs in tests with assertThrows#215

Merged
garydgregory merged 3 commits intoapache:masterfrom
strangelookingnerd:improve_assertions
Jan 11, 2025
Merged

Replace try-catch constructs in tests with assertThrows#215
garydgregory merged 3 commits intoapache:masterfrom
strangelookingnerd:improve_assertions

Conversation

@strangelookingnerd
Copy link
Contributor

As requested in #214 (comment)

  • Simplified tests by replacing try-catch constructs with assertThrows and assertDoesNotThrow

Verified with mvn clean verify that build passes before and after my changes.
Overall number of tests and coverage did not change.

Copy link
Member

@raboof raboof left a comment

Choose a reason for hiding this comment

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

Overall these seem like very nice improvements, thanks!

I added some minor questions - I'm not too familiar with the codebase yet so these are not necessarily criticisms of the PR, but more for my understanding ;)

Copy link
Member

@raboof raboof left a comment

Choose a reason for hiding this comment

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

Nice, LGTM! There's one failing GHA job, but that one's marked 'experimental', I think that means we don't expect it to pass.

Copy link
Member

@garydgregory garydgregory left a comment

Choose a reason for hiding this comment

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

Hello @strangelookingnerd
Thank you for updating the PR. I have the same comments as before though, see embedded comments.

@garydgregory garydgregory changed the title Replace try-catch constructs in tests with assertThrows and assertDoesNotThrow Replace try-catch constructs in tests with assertThrows Jan 11, 2025
@garydgregory garydgregory merged commit 7a3b96f into apache:master Jan 11, 2025
17 checks passed
@strangelookingnerd strangelookingnerd deleted the improve_assertions branch January 11, 2025 09:59
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.

3 participants