Skip to content

Commit 090970f

Browse files
Yury Rashetskakevinburke
authored andcommitted
Fix test flags initialization order
1 parent 4a05989 commit 090970f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

responses_test.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,14 @@ import (
1010

1111
// the envClient is configured to use an Account Sid and Auth Token set in the
1212
// environment. all non-short tests should use the envClient
13-
var envClient = NewClient(os.Getenv("TWILIO_ACCOUNT_SID"), os.Getenv("TWILIO_AUTH_TOKEN"), nil)
13+
var envClient *Client
14+
15+
func init() {
16+
if os.Getenv("TWILIO_ACCOUNT_SID") == "" {
17+
os.Stderr.WriteString("warning: no TWILIO_ACCOUNT_SID configured, HTTP tests will probably fail...\n\n")
18+
}
19+
envClient = NewClient(os.Getenv("TWILIO_ACCOUNT_SID"), os.Getenv("TWILIO_AUTH_TOKEN"), nil)
20+
}
1421

1522
type Server struct {
1623
s *httptest.Server

0 commit comments

Comments
 (0)