chore_: use t.Cleanup
This commit is contained in:
parent
fcc995f157
commit
4eb420d179
|
@ -12,9 +12,9 @@ func TestGo(t *testing.T) {
|
|||
paniced := false
|
||||
panicErr := "test panic"
|
||||
oldDefaultPanicFunc := defaultPanicFunc
|
||||
defer func() {
|
||||
t.Cleanup(func() {
|
||||
defaultPanicFunc = oldDefaultPanicFunc
|
||||
}()
|
||||
})
|
||||
defaultPanicFunc = func(err any) {
|
||||
require.NotNil(t, err)
|
||||
paniced = true
|
||||
|
|
Loading…
Reference in New Issue