test-go / testify

A toolkit with common assertions and mocks that plays nicely with the standard library
MIT License
24 stars 1 forks source link

Add support for go 1.9 t.Helper() method #12

Closed vanackere closed 6 years ago

vanackere commented 6 years ago

See https://golang.org/pkg/testing/#T.Helper for documentation of this new method.

On go >= 1.9 this allows to mark assert/require functions as test helper functions and get the proper trace without further work.

On go < 1.9 the previous behaviour (manual computation of caller info, added to the message log) is kept.