Skip to content

Commit 7aef158

Browse files
committed
ensure panic comes from mockT
1 parent cdd4c2d commit 7aef158

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
@@ -516,7 +516,11 @@ func TestTest_factoryError(t *testing.T) {
516516

517517
func() {
518518
defer func() {
519-
recover()
519+
if r := recover(); r != nil {
520+
if !strings.HasPrefix(r.(string), "mockT") {
521+
panic(r)
522+
}
523+
}
520524
}()
521525
Test(mt, TestCase{
522526
ProviderFactories: map[string]terraform.ResourceProviderFactory{

0 commit comments

Comments
 (0)