@@ -84,7 +84,9 @@ def parse_interop_client_args(argv):
8484 type = str ,
8585 help = "the server host to which to claim to connect" ,
8686 )
87- parser .add_argument ("--oauth_scope" , type = str , help = "scope for OAuth tokens" )
87+ parser .add_argument (
88+ "--oauth_scope" , type = str , help = "scope for OAuth tokens"
89+ )
8890 parser .add_argument (
8991 "--default_service_account" ,
9092 type = str ,
@@ -170,10 +172,14 @@ def get_secure_channel_parameters(args):
170172 request = google_auth .transport .requests .Request (),
171173 )
172174 )
173- channel_credentials = grpc .compute_engine_channel_credentials (call_creds )
175+ channel_credentials = grpc .compute_engine_channel_credentials (
176+ call_creds
177+ )
174178 else :
175179 raise ValueError (
176- "Unknown credentials type '{}'" .format (args .custom_credentials_type )
180+ "Unknown credentials type '{}'" .format (
181+ args .custom_credentials_type
182+ )
177183 )
178184 elif args .use_tls :
179185 if args .use_test_ca :
@@ -215,7 +221,9 @@ def intercept_unary_unary(self, continuation, client_call_details, request):
215221 sent_span_name = f"Sent.{ full_method } "
216222 attempt_span_name = f"Attempt.{ full_method } "
217223
218- sent_span = self ._tracer .start_span (sent_span_name , kind = trace .SpanKind .CLIENT )
224+ sent_span = self ._tracer .start_span (
225+ sent_span_name , kind = trace .SpanKind .CLIENT
226+ )
219227 sent_ctx = trace .set_span_in_context (sent_span )
220228 attempt_span = self ._tracer .start_span (
221229 attempt_span_name , kind = trace .SpanKind .CLIENT , context = sent_ctx
@@ -254,7 +262,11 @@ def intercept_unary_unary(self, continuation, client_call_details, request):
254262def _create_channel (args ):
255263 target = "{}:{}" .format (args .server_host , args .server_port )
256264
257- if args .use_tls or args .use_alts or args .custom_credentials_type is not None :
265+ if (
266+ args .use_tls
267+ or args .use_alts
268+ or args .custom_credentials_type is not None
269+ ):
258270 channel_credentials , options = get_secure_channel_parameters (args )
259271 channel = grpc .secure_channel (target , channel_credentials , options )
260272 else :
@@ -264,7 +276,9 @@ def _create_channel(args):
264276 from tests .interop import otel_interop_helper
265277
266278 _ , tracer = otel_interop_helper .init_tracer_provider ()
267- channel = grpc .intercept_channel (channel , _OTelClientInterceptor (tracer ))
279+ channel = grpc .intercept_channel (
280+ channel , _OTelClientInterceptor (tracer )
281+ )
268282
269283 return channel
270284
@@ -305,3 +319,4 @@ def test_interoperability(args):
305319
306320if __name__ == "__main__" :
307321 app .run (test_interoperability , flags_parser = parse_interop_client_args )
322+
0 commit comments