@@ -124,15 +124,15 @@ def recorder(loop):
124
124
patcher .stop ()
125
125
126
126
127
- async def test_ok (test_client , loop , recorder ):
127
+ async def test_ok (aiohttp_client , loop , recorder ):
128
128
"""
129
129
Test a normal response
130
130
131
- :param test_client : AioHttp test client fixture
131
+ :param aiohttp_client : AioHttp test client fixture
132
132
:param loop: Eventloop fixture
133
133
:param recorder: X-Ray recorder fixture
134
134
"""
135
- client = await test_client (ServerTest .app (loop = loop ))
135
+ client = await aiohttp_client (ServerTest .app (loop = loop ))
136
136
137
137
resp = await client .get ('/' )
138
138
assert resp .status == 200
@@ -148,15 +148,15 @@ async def test_ok(test_client, loop, recorder):
148
148
assert response ['status' ] == 200
149
149
150
150
151
- async def test_ok_x_forwarded_for (test_client , loop , recorder ):
151
+ async def test_ok_x_forwarded_for (aiohttp_client , loop , recorder ):
152
152
"""
153
153
Test a normal response with x_forwarded_for headers
154
154
155
- :param test_client : AioHttp test client fixture
155
+ :param aiohttp_client : AioHttp test client fixture
156
156
:param loop: Eventloop fixture
157
157
:param recorder: X-Ray recorder fixture
158
158
"""
159
- client = await test_client (ServerTest .app (loop = loop ))
159
+ client = await aiohttp_client (ServerTest .app (loop = loop ))
160
160
161
161
resp = await client .get ('/' , headers = {'X-Forwarded-For' : 'foo' })
162
162
assert resp .status == 200
@@ -166,15 +166,15 @@ async def test_ok_x_forwarded_for(test_client, loop, recorder):
166
166
assert segment .http ['request' ]['x_forwarded_for' ]
167
167
168
168
169
- async def test_ok_content_length (test_client , loop , recorder ):
169
+ async def test_ok_content_length (aiohttp_client , loop , recorder ):
170
170
"""
171
171
Test a normal response with content length as response header
172
172
173
- :param test_client : AioHttp test client fixture
173
+ :param aiohttp_client : AioHttp test client fixture
174
174
:param loop: Eventloop fixture
175
175
:param recorder: X-Ray recorder fixture
176
176
"""
177
- client = await test_client (ServerTest .app (loop = loop ))
177
+ client = await aiohttp_client (ServerTest .app (loop = loop ))
178
178
179
179
resp = await client .get ('/?content_length=100' )
180
180
assert resp .status == 200
@@ -183,15 +183,15 @@ async def test_ok_content_length(test_client, loop, recorder):
183
183
assert segment .http ['response' ]['content_length' ] == 100
184
184
185
185
186
- async def test_error (test_client , loop , recorder ):
186
+ async def test_error (aiohttp_client , loop , recorder ):
187
187
"""
188
188
Test a 4XX response
189
189
190
- :param test_client : AioHttp test client fixture
190
+ :param aiohttp_client : AioHttp test client fixture
191
191
:param loop: Eventloop fixture
192
192
:param recorder: X-Ray recorder fixture
193
193
"""
194
- client = await test_client (ServerTest .app (loop = loop ))
194
+ client = await aiohttp_client (ServerTest .app (loop = loop ))
195
195
196
196
resp = await client .get ('/error' )
197
197
assert resp .status == 404
@@ -208,15 +208,15 @@ async def test_error(test_client, loop, recorder):
208
208
assert response ['status' ] == 404
209
209
210
210
211
- async def test_exception (test_client , loop , recorder ):
211
+ async def test_exception (aiohttp_client , loop , recorder ):
212
212
"""
213
213
Test handling an exception
214
214
215
- :param test_client : AioHttp test client fixture
215
+ :param aiohttp_client : AioHttp test client fixture
216
216
:param loop: Eventloop fixture
217
217
:param recorder: X-Ray recorder fixture
218
218
"""
219
- client = await test_client (ServerTest .app (loop = loop ))
219
+ client = await aiohttp_client (ServerTest .app (loop = loop ))
220
220
221
221
with pytest .raises (Exception ):
222
222
await client .get ('/exception' )
@@ -235,15 +235,15 @@ async def test_exception(test_client, loop, recorder):
235
235
assert exception .type == 'CancelledError'
236
236
237
237
238
- async def test_unhauthorized (test_client , loop , recorder ):
238
+ async def test_unhauthorized (aiohttp_client , loop , recorder ):
239
239
"""
240
240
Test a 401 response
241
241
242
- :param test_client : AioHttp test client fixture
242
+ :param aiohttp_client : AioHttp test client fixture
243
243
:param loop: Eventloop fixture
244
244
:param recorder: X-Ray recorder fixture
245
245
"""
246
- client = await test_client (ServerTest .app (loop = loop ))
246
+ client = await aiohttp_client (ServerTest .app (loop = loop ))
247
247
248
248
resp = await client .get ('/unauthorized' )
249
249
assert resp .status == 401
@@ -260,8 +260,8 @@ async def test_unhauthorized(test_client, loop, recorder):
260
260
assert response ['status' ] == 401
261
261
262
262
263
- async def test_response_trace_header (test_client , loop , recorder ):
264
- client = await test_client (ServerTest .app (loop = loop ))
263
+ async def test_response_trace_header (aiohttp_client , loop , recorder ):
264
+ client = await aiohttp_client (ServerTest .app (loop = loop ))
265
265
resp = await client .get ('/' )
266
266
xray_header = resp .headers [http .XRAY_HEADER ]
267
267
segment = recorder .emitter .pop ()
@@ -270,15 +270,15 @@ async def test_response_trace_header(test_client, loop, recorder):
270
270
assert expected in xray_header
271
271
272
272
273
- async def test_concurrent (test_client , loop , recorder ):
273
+ async def test_concurrent (aiohttp_client , loop , recorder ):
274
274
"""
275
275
Test multiple concurrent requests
276
276
277
- :param test_client : AioHttp test client fixture
277
+ :param aiohttp_client : AioHttp test client fixture
278
278
:param loop: Eventloop fixture
279
279
:param recorder: X-Ray recorder fixture
280
280
"""
281
- client = await test_client (ServerTest .app (loop = loop ))
281
+ client = await aiohttp_client (ServerTest .app (loop = loop ))
282
282
283
283
recorder .emitter = CustomStubbedEmitter ()
284
284
@@ -296,16 +296,16 @@ async def get_delay():
296
296
assert len (ids ) == len (set (ids ))
297
297
298
298
299
- async def test_disabled_sdk (test_client , loop , recorder ):
299
+ async def test_disabled_sdk (aiohttp_client , loop , recorder ):
300
300
"""
301
301
Test a normal response when the SDK is disabled.
302
302
303
- :param test_client : AioHttp test client fixture
303
+ :param aiohttp_client : AioHttp test client fixture
304
304
:param loop: Eventloop fixture
305
305
:param recorder: X-Ray recorder fixture
306
306
"""
307
307
global_sdk_config .set_sdk_enabled (False )
308
- client = await test_client (ServerTest .app (loop = loop ))
308
+ client = await aiohttp_client (ServerTest .app (loop = loop ))
309
309
310
310
resp = await client .get ('/' )
311
311
assert resp .status == 200
0 commit comments