File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -202,18 +202,20 @@ def test_gql():
202
202
assert result ["user" ] is None
203
203
204
204
205
+ @pytest .mark .requests
205
206
def test_sync_transport_close_on_schema_retrieval_failure ():
206
207
"""
207
208
Ensure that the transport session is closed if an error occurs when
208
209
entering the context manager (e.g., because schema retrieval fails)
209
210
"""
210
211
211
212
from gql .transport .requests import RequestsHTTPTransport
213
+
212
214
transport = RequestsHTTPTransport (url = "http://localhost/" )
213
215
client = Client (transport = transport , fetch_schema_from_transport = True )
214
216
215
217
try :
216
- with client as session :
218
+ with client :
217
219
pass
218
220
except Exception :
219
221
# we don't care what exception is thrown, we just want to check if the
@@ -232,11 +234,12 @@ async def test_async_transport_close_on_schema_retrieval_failure():
232
234
"""
233
235
234
236
from gql .transport .aiohttp import AIOHTTPTransport
237
+
235
238
transport = AIOHTTPTransport (url = "http://localhost/" )
236
239
client = Client (transport = transport , fetch_schema_from_transport = True )
237
240
238
241
try :
239
- async with client as session :
242
+ async with client :
240
243
pass
241
244
except Exception :
242
245
# we don't care what exception is thrown, we just want to check if the
You can’t perform that action at this time.
0 commit comments