Skip to content

Commit

Permalink
test: Require no errors when none expected (#1509)
Browse files Browse the repository at this point in the history
## Relevant issue(s)

Resolves #1207

## Description

Requires no errors when none expected instead of just asserting. Asserts
here typically result in panics which confuses the logs and the
developer looking at them.
  • Loading branch information
AndrewSisley committed May 17, 2023
1 parent 0621856 commit e361562
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/integration/utils2.go
Original file line number Diff line number Diff line change
Expand Up @@ -1145,7 +1145,7 @@ func AssertError(t *testing.T, description string, err error, expectedError stri
}

if expectedError == "" {
assert.NoError(t, err, description)
require.NoError(t, err, description)
return false
} else {
if !strings.Contains(err.Error(), expectedError) {
Expand All @@ -1165,7 +1165,7 @@ func AssertErrors(
expectedError string,
) bool {
if expectedError == "" {
assert.Empty(t, errs, description)
require.Empty(t, errs, description)
} else {
for _, e := range errs {
// This is always a string at the moment, add support for other types as and when needed
Expand Down

0 comments on commit e361562

Please sign in to comment.