Skip to content

Commit 47777b2

Browse files
committed
ensure panic comes from mockT
1 parent b41c06e commit 47777b2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

helper/resource/testing_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ func TestTest_factoryError(t *testing.T) {
4646

4747
func() {
4848
defer func() {
49-
recover()
49+
if r := recover(); r != nil {
50+
if !strings.HasPrefix(r.(string), "mockT") {
51+
panic(r)
52+
}
53+
}
5054
}()
5155
Test(mt, TestCase{
5256
ProviderFactories: map[string]func() (*schema.Provider, error){

0 commit comments

Comments
 (0)