@@ -60,9 +60,8 @@ def test_smoke_with_auth_fail1(tls_ca_cert):
6060 os .environ ["GOODDATA_FLIGHT_SERVER__AUTHENTICATION_METHOD" ] = "token"
6161 os .environ ["GOODDATA_FLIGHT_ENUMERATED_TOKENS__TOKENS" ] = '["t1", "t2"]'
6262
63- with server (_TestingMethods (), tls = True ) as s :
64- with pytest .raises (pyarrow .flight .FlightUnauthenticatedError ):
65- list (pyarrow .flight .FlightClient (s .location , tls_root_certs = tls_ca_cert ).list_flights ())
63+ with server (_TestingMethods (), tls = True ) as s , pytest .raises (pyarrow .flight .FlightUnauthenticatedError ):
64+ list (pyarrow .flight .FlightClient (s .location , tls_root_certs = tls_ca_cert ).list_flights ())
6665
6766
6867def test_smoke_with_auth_fail2 (tls_ca_cert ):
@@ -71,9 +70,8 @@ def test_smoke_with_auth_fail2(tls_ca_cert):
7170
7271 # important: header names must be lowercase
7372 opts = FlightCallOptions (headers = [(b"authorization" , b"Bearer 123" )])
74- with server (_TestingMethods (), tls = True ) as s :
75- with pytest .raises (pyarrow .flight .FlightUnauthenticatedError ):
76- list (pyarrow .flight .FlightClient (s .location , tls_root_certs = tls_ca_cert ).list_flights (b"" , opts ))
73+ with server (_TestingMethods (), tls = True ) as s , pytest .raises (pyarrow .flight .FlightUnauthenticatedError ):
74+ list (pyarrow .flight .FlightClient (s .location , tls_root_certs = tls_ca_cert ).list_flights (b"" , opts ))
7775
7876
7977def test_smoke_with_auth1 (tls_ca_cert ):
@@ -107,10 +105,9 @@ def test_smoke_with_custom_auth_fail1(tls_ca_cert):
107105 os .environ ["GOODDATA_FLIGHT_SERVER__TOKEN_VERIFICATION" ] = "tests.server.testing_token_verifier"
108106
109107 opts = FlightCallOptions (headers = [(b"x-some-bad-header" , b"test_token" )])
110- with server (_TestingMethods (), tls = True ) as s :
111- with pytest .raises (pyarrow .flight .FlightUnauthenticatedError ):
112- c = pyarrow .flight .FlightClient (s .location , tls_root_certs = tls_ca_cert )
113- tuple (c .list_flights (b"" , opts ))
108+ with server (_TestingMethods (), tls = True ) as s , pytest .raises (pyarrow .flight .FlightUnauthenticatedError ):
109+ c = pyarrow .flight .FlightClient (s .location , tls_root_certs = tls_ca_cert )
110+ tuple (c .list_flights (b"" , opts ))
114111
115112
116113def test_smoke_with_custom_auth_fail2 (tls_ca_cert ):
@@ -119,7 +116,6 @@ def test_smoke_with_custom_auth_fail2(tls_ca_cert):
119116 os .environ ["GOODDATA_FLIGHT_SERVER__TOKEN_VERIFICATION" ] = "tests.server.testing_token_verifier"
120117
121118 opts = FlightCallOptions (headers = [(b"x-custom-token-header" , b"invalid" )])
122- with server (_TestingMethods (), tls = True ) as s :
123- with pytest .raises (pyarrow .flight .FlightUnauthenticatedError ):
124- c = pyarrow .flight .FlightClient (s .location , tls_root_certs = tls_ca_cert )
125- tuple (c .list_flights (b"" , opts ))
119+ with server (_TestingMethods (), tls = True ) as s , pytest .raises (pyarrow .flight .FlightUnauthenticatedError ):
120+ c = pyarrow .flight .FlightClient (s .location , tls_root_certs = tls_ca_cert )
121+ tuple (c .list_flights (b"" , opts ))
0 commit comments