testify
testify copied to clipboard
SetupTest does not run on subtests
Here you can see test failing https://play.golang.org/p/R3m0s_PxwGG
If we call SetupTest()
manually inside the subtest works correctly: https://play.golang.org/p/XpsmRqH2F4t
Is this intended behaviour?
What's the state of this? I'd really use a hook like SetupSubTest
or something like this. I use subtests not just for table testing but for documenting each scenario of the function that I'm testing, and thus I end up executing SetupTest
on each subtest. Maybe we could implement it in a PR or something?
duplicate of https://github.com/stretchr/testify/issues/1031