File tree Expand file tree Collapse file tree 2 files changed +13
-12
lines changed Expand file tree Collapse file tree 2 files changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -537,7 +537,6 @@ func Test(t TestT, c TestCase) {
537537 // We require verbose mode so that the user knows what is going on.
538538 if ! testing .Verbose () && ! c .IsUnitTest {
539539 t .Fatal ("Acceptance tests must be run with the -v flag on tests" )
540- return
541540 }
542541
543542 // Run the PreCheck if we have it
Original file line number Diff line number Diff line change 66 "fmt"
77 "os"
88 "reflect"
9- "regexp"
109 "sort"
1110 "strings"
1211 "testing"
@@ -43,18 +42,19 @@ func TestTest_factoryError(t *testing.T) {
4342 factory := func () (* schema.Provider , error ) {
4443 return nil , resourceFactoryError
4544 }
46-
4745 mt := new (mockT )
48- Test (mt , TestCase {
49- ProviderFactories : map [string ]func () (* schema.Provider , error ){
50- "test" : factory ,
51- },
52- Steps : []TestStep {
53- {
54- ExpectError : regexp .MustCompile ("resource factory error" ),
46+
47+ func () {
48+ defer func () {
49+ recover ()
50+ }()
51+ Test (mt , TestCase {
52+ ProviderFactories : map [string ]func () (* schema.Provider , error ){
53+ "test" : factory ,
5554 },
56- },
57- })
55+ IsUnitTest : true ,
56+ })
57+ }()
5858
5959 if ! mt .failed () {
6060 t .Fatal ("test should've failed" )
@@ -161,6 +161,8 @@ func (t *mockT) Fatal(args ...interface{}) {
161161 t .FatalCalled = true
162162 t .FatalArgs = args
163163 t .f = true
164+
165+ panic ("mockT.Fatal" )
164166}
165167
166168func (t * mockT ) Parallel () {
You can’t perform that action at this time.
0 commit comments