fix: improve Error Trace output by boekkooi-impossiblecloud 路 Pull Request #92 路 go-openapi/testify (original) (raw)

Change type

馃敡 Bug fix

Short description

When using EventuallyWith the failure always show the testing.go:110 as the source which makes things hard to debug.
This PR resolves that issue.

Fixes

package cache

import ( "testing" "time"

"github.com/go-openapi/testify/v2/assert"

)

func TestExample_Failure(t *testing.T) { assert.EventuallyWith(t, func(collect assert.CollectT) { time.Sleep(time.Millisecond) }, 2time.Microsecond, time.Microsecond) }

Current behavior

=== RUN   TestExample_Failure
    condition.go:558: context deadline exceeded
    testing.go:110: 
            Error Trace:	/home/warnar/.asdf/installs/golang/1.26.2/go/src/runtime/asm_amd64.s:1771
            Error:      	condition never satisfied
            Test:       	TestExample_Failure
    condition.go:334: context deadline exceeded
--- FAIL: TestExample_Failure (0.00s)

FAIL

New behavior

=== RUN   TestExample_Failure
    example_test.go:11:
            Error Trace:	example_test.go:11
            Error:      	condition never satisfied
            Test:       	TestExample_Failure
--- FAIL: TestExample_Failure (0.00s)

FAIL

Checklist