@@ -83,8 +83,6 @@ def _test_imports():
83
83
from oauth2client .client import GoogleCredentials # noqa
84
84
from oauth2client .client import OAuth2WebServerFlow # noqa
85
85
from oauth2client .client import AccessTokenRefreshError # noqa
86
- from oauth2client .client import \
87
- ApplicationDefaultCredentialsError # noqa
88
86
89
87
from oauth2client .file import Storage # noqa
90
88
from oauth2client .tools import run_flow # noqa
@@ -138,8 +136,7 @@ def _test_imports():
138
136
oauth2client_v1 = False
139
137
140
138
try :
141
- from oauth2client .service_account import \
142
- ServiceAccountCredentials # noqa
139
+ from oauth2client .service_account import ServiceAccountCredentials # noqa
143
140
except ImportError :
144
141
oauth2client_v2 = False
145
142
@@ -161,8 +158,7 @@ def clean_gbq_environment(private_key=None):
161
158
for i in range (1 , 10 ):
162
159
if DATASET_ID + str (i ) in dataset .datasets ():
163
160
dataset_id = DATASET_ID + str (i )
164
- table = gbq ._Table (PROJECT_ID , dataset_id ,
165
- private_key = private_key )
161
+ table = gbq ._Table (PROJECT_ID , dataset_id , private_key = private_key )
166
162
for j in range (1 , 20 ):
167
163
if TABLE_ID + str (j ) in dataset .tables (dataset_id ):
168
164
table .delete (TABLE_ID + str (j ))
@@ -192,13 +188,15 @@ def test_generate_bq_schema_deprecated():
192
188
df = make_mixed_dataframe_v2 (10 )
193
189
gbq .generate_bq_schema (df )
194
190
191
+
195
192
def google_credentials_import ():
196
193
try :
197
194
from oauth2client .client import GoogleCredentials
198
195
return GoogleCredentials
199
196
except ImportError :
200
197
return type (None )
201
198
199
+
202
200
def test_should_be_able_to_get_credentials_from_default_credentials ():
203
201
GoogleCredentials = google_credentials_import ()
204
202
connector = gbq .GbqConnector
0 commit comments