12
12
13
13
14
14
@pytest .fixture (scope = 'function' )
15
- def recorder (loop ):
15
+ def recorder (event_loop ):
16
16
"""
17
17
Clean up before and after each test run
18
18
"""
19
- xray_recorder .configure (service = 'test' , sampling = False , context = AsyncContext (loop = loop ))
19
+ xray_recorder .configure (
20
+ service = 'test' , sampling = False , context = AsyncContext (loop = event_loop )
21
+ )
20
22
xray_recorder .clear_trace_entities ()
21
23
yield xray_recorder
22
24
xray_recorder .clear_trace_entities ()
23
25
24
26
25
- async def test_describe_table (loop , recorder ):
27
+ async def test_describe_table (event_loop , recorder ):
26
28
segment = recorder .begin_segment ('name' )
27
29
28
30
req_id = '1234'
@@ -45,7 +47,7 @@ async def test_describe_table(loop, recorder):
45
47
assert aws_meta ['operation' ] == 'DescribeTable'
46
48
47
49
48
- async def test_s3_parameter_capture (loop , recorder ):
50
+ async def test_s3_parameter_capture (event_loop , recorder ):
49
51
segment = recorder .begin_segment ('name' )
50
52
51
53
bucket_name = 'mybucket'
@@ -70,7 +72,7 @@ async def test_s3_parameter_capture(loop, recorder):
70
72
assert aws_meta ['operation' ] == 'GetObject'
71
73
72
74
73
- async def test_list_parameter_counting (loop , recorder ):
75
+ async def test_list_parameter_counting (event_loop , recorder ):
74
76
"""
75
77
Test special parameters that have shape of list are recorded
76
78
as count based on `para_whitelist.json`
@@ -103,7 +105,7 @@ async def test_list_parameter_counting(loop, recorder):
103
105
assert aws_meta ['queue_name_prefix' ] == queue_name_prefix
104
106
105
107
106
- async def test_map_parameter_grouping (loop , recorder ):
108
+ async def test_map_parameter_grouping (event_loop , recorder ):
107
109
"""
108
110
Test special parameters that have shape of map are recorded
109
111
as a list of keys based on `para_whitelist.json`
@@ -131,9 +133,10 @@ async def test_map_parameter_grouping(loop, recorder):
131
133
assert sorted (aws_meta ['table_names' ]) == ['table1' , 'table2' ]
132
134
133
135
134
- async def test_context_missing_not_swallow_return (loop , recorder ):
136
+ async def test_context_missing_not_swallow_return (event_loop , recorder ):
135
137
xray_recorder .configure (service = 'test' , sampling = False ,
136
- context = AsyncContext (loop = loop ), context_missing = 'LOG_ERROR' )
138
+ context = AsyncContext (loop = event_loop ),
139
+ context_missing = 'LOG_ERROR' )
137
140
138
141
response = {'ResponseMetadata' : {'RequestId' : '1234' , 'HTTPStatusCode' : 403 }}
139
142
@@ -146,9 +149,10 @@ async def test_context_missing_not_swallow_return(loop, recorder):
146
149
assert actual_resp == response
147
150
148
151
149
- async def test_context_missing_not_suppress_exception (loop , recorder ):
152
+ async def test_context_missing_not_suppress_exception (event_loop , recorder ):
150
153
xray_recorder .configure (service = 'test' , sampling = False ,
151
- context = AsyncContext (loop = loop ), context_missing = 'LOG_ERROR' )
154
+ context = AsyncContext (loop = event_loop ),
155
+ context_missing = 'LOG_ERROR' )
152
156
153
157
session = get_session ()
154
158
async with session .create_client ('dynamodb' , region_name = 'eu-west-2' ) as client :
0 commit comments