@@ -120,15 +120,15 @@ def recorder(loop):
120
120
patcher .stop ()
121
121
122
122
123
- async def test_ok (test_client , loop , recorder ):
123
+ async def test_ok (aiohttp_client , loop , recorder ):
124
124
"""
125
125
Test a normal response
126
126
127
- :param test_client : AioHttp test client fixture
127
+ :param aiohttp_client : AioHttp test client fixture
128
128
:param loop: Eventloop fixture
129
129
:param recorder: X-Ray recorder fixture
130
130
"""
131
- client = await test_client (ServerTest .app (loop = loop ))
131
+ client = await aiohttp_client (ServerTest .app (loop = loop ))
132
132
133
133
resp = await client .get ('/' )
134
134
assert resp .status == 200
@@ -144,15 +144,15 @@ async def test_ok(test_client, loop, recorder):
144
144
assert response ['status' ] == 200
145
145
146
146
147
- async def test_ok_x_forwarded_for (test_client , loop , recorder ):
147
+ async def test_ok_x_forwarded_for (aiohttp_client , loop , recorder ):
148
148
"""
149
149
Test a normal response with x_forwarded_for headers
150
150
151
- :param test_client : AioHttp test client fixture
151
+ :param aiohttp_client : AioHttp test client fixture
152
152
:param loop: Eventloop fixture
153
153
:param recorder: X-Ray recorder fixture
154
154
"""
155
- client = await test_client (ServerTest .app (loop = loop ))
155
+ client = await aiohttp_client (ServerTest .app (loop = loop ))
156
156
157
157
resp = await client .get ('/' , headers = {'X-Forwarded-For' : 'foo' })
158
158
assert resp .status == 200
@@ -162,15 +162,15 @@ async def test_ok_x_forwarded_for(test_client, loop, recorder):
162
162
assert segment .http ['request' ]['x_forwarded_for' ]
163
163
164
164
165
- async def test_ok_content_length (test_client , loop , recorder ):
165
+ async def test_ok_content_length (aiohttp_client , loop , recorder ):
166
166
"""
167
167
Test a normal response with content length as response header
168
168
169
- :param test_client : AioHttp test client fixture
169
+ :param aiohttp_client : AioHttp test client fixture
170
170
:param loop: Eventloop fixture
171
171
:param recorder: X-Ray recorder fixture
172
172
"""
173
- client = await test_client (ServerTest .app (loop = loop ))
173
+ client = await aiohttp_client (ServerTest .app (loop = loop ))
174
174
175
175
resp = await client .get ('/?content_length=100' )
176
176
assert resp .status == 200
@@ -179,15 +179,15 @@ async def test_ok_content_length(test_client, loop, recorder):
179
179
assert segment .http ['response' ]['content_length' ] == 100
180
180
181
181
182
- async def test_error (test_client , loop , recorder ):
182
+ async def test_error (aiohttp_client , loop , recorder ):
183
183
"""
184
184
Test a 4XX response
185
185
186
- :param test_client : AioHttp test client fixture
186
+ :param aiohttp_client : AioHttp test client fixture
187
187
:param loop: Eventloop fixture
188
188
:param recorder: X-Ray recorder fixture
189
189
"""
190
- client = await test_client (ServerTest .app (loop = loop ))
190
+ client = await aiohttp_client (ServerTest .app (loop = loop ))
191
191
192
192
resp = await client .get ('/error' )
193
193
assert resp .status == 404
@@ -204,15 +204,15 @@ async def test_error(test_client, loop, recorder):
204
204
assert response ['status' ] == 404
205
205
206
206
207
- async def test_exception (test_client , loop , recorder ):
207
+ async def test_exception (aiohttp_client , loop , recorder ):
208
208
"""
209
209
Test handling an exception
210
210
211
- :param test_client : AioHttp test client fixture
211
+ :param aiohttp_client : AioHttp test client fixture
212
212
:param loop: Eventloop fixture
213
213
:param recorder: X-Ray recorder fixture
214
214
"""
215
- client = await test_client (ServerTest .app (loop = loop ))
215
+ client = await aiohttp_client (ServerTest .app (loop = loop ))
216
216
217
217
with pytest .raises (Exception ):
218
218
await client .get ('/exception' )
@@ -231,15 +231,15 @@ async def test_exception(test_client, loop, recorder):
231
231
assert exception .type == 'CancelledError'
232
232
233
233
234
- async def test_unhauthorized (test_client , loop , recorder ):
234
+ async def test_unhauthorized (aiohttp_client , loop , recorder ):
235
235
"""
236
236
Test a 401 response
237
237
238
- :param test_client : AioHttp test client fixture
238
+ :param aiohttp_client : AioHttp test client fixture
239
239
:param loop: Eventloop fixture
240
240
:param recorder: X-Ray recorder fixture
241
241
"""
242
- client = await test_client (ServerTest .app (loop = loop ))
242
+ client = await aiohttp_client (ServerTest .app (loop = loop ))
243
243
244
244
resp = await client .get ('/unauthorized' )
245
245
assert resp .status == 401
@@ -256,8 +256,8 @@ async def test_unhauthorized(test_client, loop, recorder):
256
256
assert response ['status' ] == 401
257
257
258
258
259
- async def test_response_trace_header (test_client , loop , recorder ):
260
- client = await test_client (ServerTest .app (loop = loop ))
259
+ async def test_response_trace_header (aiohttp_client , loop , recorder ):
260
+ client = await aiohttp_client (ServerTest .app (loop = loop ))
261
261
resp = await client .get ('/' )
262
262
xray_header = resp .headers [http .XRAY_HEADER ]
263
263
segment = recorder .emitter .pop ()
@@ -266,15 +266,15 @@ async def test_response_trace_header(test_client, loop, recorder):
266
266
assert expected in xray_header
267
267
268
268
269
- async def test_concurrent (test_client , loop , recorder ):
269
+ async def test_concurrent (aiohttp_client , loop , recorder ):
270
270
"""
271
271
Test multiple concurrent requests
272
272
273
- :param test_client : AioHttp test client fixture
273
+ :param aiohttp_client : AioHttp test client fixture
274
274
:param loop: Eventloop fixture
275
275
:param recorder: X-Ray recorder fixture
276
276
"""
277
- client = await test_client (ServerTest .app (loop = loop ))
277
+ client = await aiohttp_client (ServerTest .app (loop = loop ))
278
278
279
279
recorder .emitter = CustomStubbedEmitter ()
280
280
@@ -292,16 +292,16 @@ async def get_delay():
292
292
assert len (ids ) == len (set (ids ))
293
293
294
294
295
- async def test_disabled_sdk (test_client , loop , recorder ):
295
+ async def test_disabled_sdk (aiohttp_client , loop , recorder ):
296
296
"""
297
297
Test a normal response when the SDK is disabled.
298
298
299
- :param test_client : AioHttp test client fixture
299
+ :param aiohttp_client : AioHttp test client fixture
300
300
:param loop: Eventloop fixture
301
301
:param recorder: X-Ray recorder fixture
302
302
"""
303
303
global_sdk_config .set_sdk_enabled (False )
304
- client = await test_client (ServerTest .app (loop = loop ))
304
+ client = await aiohttp_client (ServerTest .app (loop = loop ))
305
305
306
306
resp = await client .get ('/' )
307
307
assert resp .status == 200
0 commit comments