stretchr / testify

A toolkit with common assertions and mocks that plays nicely with the standard library
MIT License
22.5k stars 1.56k forks source link

Diffs no longer call string() #1108

Open b-gupta opened 2 years ago

b-gupta commented 2 years ago

https://github.com/stretchr/testify/blob/master/assert/assertions.go#L1654

    // DisableMethods specifies whether or not error and Stringer interfaces are
    // invoked for types that implement them.

Not sure why this was added by default. Can we make this configurable or remove it?

tjanez commented 2 years ago

To save others some time, here is the relevant line:

https://github.com/stretchr/testify/blob/ab6dc3262822ed562480c19876b0257ace761e3e/assert/assertions.go#L1658

that configures the go-spew's behavior.

And here is the PR that changed this: https://github.com/stretchr/testify/pull/895.

mitar commented 2 months ago

I got bitten by this as well. :-(