testify
testify copied to clipboard
A toolkit with common assertions and mocks that plays nicely with the standard library
## Summary This PR proposes updating `func callString` in `package mock` to format `context.Context` arguments as their pointer value, in order to avoid a data race from formatting the internals...
## Summary The PR simplifies strings inside `fmt.Sprintf` statements. ## Changes Replace `"\"%s\""` with `%q`. Replace `fmt.Sprintf("\"%s"\", reflect.TypeOf(t))` with `fmt.Sprintf("%T", t)`. ## Motivation `%q` has fewer symbols than `"\"%s\""` but...
Consider the following use of `EventuallyWithT`. ```go assert.EventuallyWithT(t, func(c *assert.CollectT) { exist, err := myFunc() require.NoError(c, err) assert.True(c, exist) }, 1*time.Second, 10*time.Millisecond, "Object was not created") ``` Here the intention...
## Summary This improves the UX of users of `ErrorIs()` in case the value `nil` is passed for `err` while an error was expected. ## Changes - added check if...
## Summary This PR removes outdated build constraints. ## Changes Remove unnecessary `// +build` comments from files in the `assert/yaml` package. ## Motivation To cleanup the code. The ["Build constraints"](https://pkg.go.dev/cmd/go#hdr-Build_constraints)...
## Summary In order to ease maintenance of downstream forks of Testify that would remove dependency on github.com/stretchr/objx we move all uses of that module in isolated source files. A...
## Description The addition of `omitzero` to [encoding/json](https://pkg.go.dev/encoding/json#Marshal) creates confusion ## Proposed solution - Add information about this to the documentation of assert.Zero, or somewhere else more appropriate - add...
## Summary Bring the un-maintained [`github.com/pmezard/go-difflib/difflib`](https://pkg.go.dev/github.com/pmezard/go-difflib/difflib) library into testify and adopt support of the package. ## Changes * Move [`github.com/pmezard/go-difflib/difflib`](https://pkg.go.dev/github.com/pmezard/go-difflib/difflib) package to `.../internal/difflib` so that it cannot be imported by...
## Summary Adds support for users to provide extra filtering on which tests to run. ## Changes A new Exported function was needed in the suite package to support this....
## Summary A simple change to provide more explicit errors message when testing the code while refactoring asserters ## Changes This helper is used to capture the testing.TB interface, and...