[Enhancement]: use testify's require instead of assert. #2808
Labels
enhancement
New feature or request
good first issue
Want to contribute to testcontainers? Start from here
hacktoberfest
Pull Requests accepted for Hacktoberfest.
low hanging fruit
Issues that are good for newcomers.
Proposal
Why?
By using
require
for crucial checks, we can avoid misleading error messages from failed assertions that come later in the test after an essential condition has already failed. This makes the root cause of the failure easier to diagnose, as the test execution halts as soon as the condition fails, preventing further unnecessary execution of test logic that depends on the success of the failed condition. This can save time, especially in long or complex tests, where subsequent steps may not be relevant after a failure.assert
, on the other hand, might allow tests to continue, resulting in multiple failures and potentially obscuring the real cause.The text was updated successfully, but these errors were encountered: