As already documented (via #1392), require.* functions/methods are only safe to use from the main test/benchmark goroutine and are unsafe otherwise. Go stdlib may fix this one way or another (golang/go#15758) but even if/when this happens, testify doesn't call those methods unless there is an assertion failure. This means the bug in the test can live in users code for a very long time.
I think ideally testify would fail the test (or panic) if a function/method from the require family is used incorrectly regardless of whether there is a failure in the test itself or not.
As already documented (via #1392),
require.*functions/methods are only safe to use from the main test/benchmark goroutine and are unsafe otherwise. Go stdlib may fix this one way or another (golang/go#15758) but even if/when this happens, testify doesn't call those methods unless there is an assertion failure. This means the bug in the test can live in users code for a very long time.I think ideally testify would fail the test (or panic) if a function/method from the
requirefamily is used incorrectly regardless of whether there is a failure in the test itself or not.