@@ -124,45 +124,46 @@ def plugin_manager_with_aurora_connection_tracker_and_read_write_splitting_plugi
124
124
125
125
126
126
def init_and_release (mocker , plugin_service_mock , plugin_manager ):
127
- wrapper = AwsWrapperConnection (mocker .MagicMock (), plugin_service_mock , plugin_service_mock , plugin_service_mock , plugin_manager )
127
+ wrapper = AwsWrapperConnection (mocker .MagicMock (), plugin_service_mock , plugin_service_mock , plugin_manager )
128
128
wrapper .release_resources ()
129
129
return wrapper
130
130
131
131
132
132
def test_init_and_release_with_execution_time_plugin (
133
- benchmark , plugin_service_mock , plugin_manager_with_execute_time_plugin ):
133
+ benchmark , mocker , plugin_service_mock , plugin_manager_with_execute_time_plugin ):
134
134
135
- result = benchmark (init_and_release , plugin_service_mock , plugin_manager_with_execute_time_plugin )
135
+ result = benchmark (init_and_release , mocker , plugin_service_mock , plugin_manager_with_execute_time_plugin )
136
136
assert result is not None
137
137
138
138
139
139
def test_init_and_release_with_aurora_connection_tracker_plugin (
140
- benchmark , plugin_service_mock , plugin_manager_with_aurora_connection_tracker_plugin ):
140
+ benchmark , mocker , plugin_service_mock , plugin_manager_with_aurora_connection_tracker_plugin ):
141
141
142
- result = benchmark (init_and_release , plugin_service_mock , plugin_manager_with_aurora_connection_tracker_plugin )
142
+ result = benchmark (init_and_release , mocker , plugin_service_mock , plugin_manager_with_aurora_connection_tracker_plugin )
143
143
assert result is not None
144
144
145
145
146
146
def test_init_and_release_with_execute_time_and_aurora_connection_tracker_plugin (
147
- benchmark , plugin_service_mock , plugin_manager_with_execute_time_and_aurora_connection_tracker_plugin ):
147
+ benchmark , mocker , plugin_service_mock , plugin_manager_with_execute_time_and_aurora_connection_tracker_plugin ):
148
148
149
149
result = benchmark (
150
- init_and_release , plugin_service_mock , plugin_manager_with_execute_time_and_aurora_connection_tracker_plugin )
150
+ init_and_release , mocker , plugin_service_mock , plugin_manager_with_execute_time_and_aurora_connection_tracker_plugin )
151
151
assert result is not None
152
152
153
153
154
154
def test_init_and_release_with_read_write_splitting_plugin (
155
- benchmark , plugin_service_mock , plugin_manager_with_read_write_splitting_plugin ):
155
+ benchmark , mocker , plugin_service_mock , plugin_manager_with_read_write_splitting_plugin ):
156
156
157
- result = benchmark (init_and_release , plugin_service_mock , plugin_manager_with_read_write_splitting_plugin )
157
+ result = benchmark (init_and_release , mocker , plugin_service_mock , plugin_manager_with_read_write_splitting_plugin )
158
158
assert result is not None
159
159
160
160
161
161
def test_init_and_release_with_aurora_connection_tracker_and_read_write_splitting_plugin (
162
- benchmark , plugin_service_mock , plugin_manager_with_aurora_connection_tracker_and_read_write_splitting_plugin ):
162
+ benchmark , mocker , plugin_service_mock , plugin_manager_with_aurora_connection_tracker_and_read_write_splitting_plugin ):
163
163
164
164
result = benchmark (
165
165
init_and_release ,
166
+ mocker ,
166
167
plugin_service_mock ,
167
168
plugin_manager_with_aurora_connection_tracker_and_read_write_splitting_plugin )
168
169
assert result is not None
@@ -182,45 +183,47 @@ def init_and_release_internal_connection_pools(mocker, plugin_service_mock, plug
182
183
183
184
184
185
def test_init_and_release_with_read_write_splitting_plugin_internal_connection_pools (
185
- benchmark , plugin_service_mock , plugin_manager_with_read_write_splitting_plugin ):
186
+ benchmark , mocker , plugin_service_mock , plugin_manager_with_read_write_splitting_plugin ):
186
187
187
188
result = benchmark (
188
189
init_and_release_internal_connection_pools ,
190
+ mocker ,
189
191
plugin_service_mock ,
190
192
plugin_manager_with_read_write_splitting_plugin )
191
193
assert result is not None
192
194
193
195
194
196
def test_init_and_release_with_aurora_connection_tracker_and_read_write_splitting_plugin_internal_connection_pools (
195
- benchmark , plugin_service_mock , plugin_manager_with_aurora_connection_tracker_and_read_write_splitting_plugin ):
197
+ benchmark , mocker , plugin_service_mock , plugin_manager_with_aurora_connection_tracker_and_read_write_splitting_plugin ):
196
198
197
199
result = benchmark (
198
200
init_and_release_internal_connection_pools ,
201
+ mocker ,
199
202
plugin_service_mock ,
200
203
plugin_manager_with_aurora_connection_tracker_and_read_write_splitting_plugin )
201
204
assert result is not None
202
205
203
206
204
207
def create_cursor_baseline (mocker , plugin_service , plugin_manager ):
205
- wrapper = AwsWrapperConnection (mocker .MagicMock (), plugin_service , plugin_manager )
208
+ wrapper = AwsWrapperConnection (mocker .MagicMock (), plugin_service , plugin_service , plugin_manager )
206
209
cursor = wrapper .cursor ()
207
210
return cursor
208
211
209
212
210
- def test_create_cursor_baseline (benchmark , plugin_service_mock , plugin_manager_with_execute_time_plugin ):
211
- result = benchmark (create_cursor_baseline , plugin_service_mock , plugin_manager_with_execute_time_plugin )
213
+ def test_create_cursor_baseline (benchmark , mocker , plugin_service_mock , plugin_manager_with_execute_time_plugin ):
214
+ result = benchmark (create_cursor_baseline , mocker , plugin_service_mock , plugin_manager_with_execute_time_plugin )
212
215
assert result is not None
213
216
214
217
215
218
def execute_query (mocker , plugin_service , plugin_manager ):
216
- wrapper = AwsWrapperConnection (mocker .MagicMock (), plugin_service , plugin_manager )
219
+ wrapper = AwsWrapperConnection (mocker .MagicMock (), plugin_service , plugin_service , plugin_manager )
217
220
cursor = wrapper .cursor ()
218
221
results = cursor .execute ("some sql" )
219
222
return results
220
223
221
224
222
225
def test_execute_query_with_execute_time_plugin (
223
- benchmark , plugin_service_mock , plugin_manager_with_execute_time_plugin ):
226
+ benchmark , mocker , plugin_service_mock , plugin_manager_with_execute_time_plugin ):
224
227
225
- result = benchmark (execute_query , plugin_service_mock , plugin_manager_with_execute_time_plugin )
228
+ result = benchmark (execute_query , mocker , plugin_service_mock , plugin_manager_with_execute_time_plugin )
226
229
assert result is not None
0 commit comments