Skip to content

Commit

Permalink
return assert.AnError from mockHostIDProviderWithError
Browse files Browse the repository at this point in the history
  • Loading branch information
mwear committed Mar 8, 2023
1 parent 8f6b557 commit 0260501
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 2 additions & 3 deletions sdk/resource/host_id_export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package resource_test

import (
"errors"
"github.com/stretchr/testify/assert"

"go.opentelemetry.io/otel/sdk/resource"
)
Expand All @@ -28,8 +28,7 @@ func mockHostIDProvider() {

func mockHostIDProviderWithError() {
resource.SetHostIDProvider(
// TODO: After #3844 merges, return assert.AnError and update tests in `resource_test.go`.
func() (string, error) { return "", errors.New("not found") },
func() (string, error) { return "", assert.AnError },
)
}

Expand Down
1 change: 1 addition & 0 deletions sdk/resource/resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@ func TestWithHostIDError(t *testing.T) {
)

require.Error(t, err)
assert.True(t, errors.Is(err, assert.AnError))
require.EqualValues(t, map[string]string{}, toMap(res))
}

Expand Down

0 comments on commit 0260501

Please sign in to comment.