Skip to content

Commit d1016a2

Browse files
committed
Remove @pytest.mark.asyncio decorator
1 parent 39e845a commit d1016a2

17 files changed

+0
-137
lines changed

tests/component_handlers/helm_wrapper/test_helm_wrapper.py

-6
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ def mock_get_version(self, mocker: MockerFixture) -> MagicMock:
5252
def helm(self, mock_get_version: MagicMock) -> Helm:
5353
return Helm(helm_config=HelmConfig())
5454

55-
@pytest.mark.asyncio()
5655
async def test_should_call_run_command_method_when_helm_install_with_defaults(
5756
self, helm: Helm, run_command_async: AsyncMock
5857
):
@@ -138,7 +137,6 @@ def test_should_include_configured_tls_parameters_on_add_when_version_is_new(
138137
),
139138
]
140139

141-
@pytest.mark.asyncio()
142140
async def test_should_include_configured_tls_parameters_on_update(
143141
self, helm: Helm, run_command_async: AsyncMock
144142
):
@@ -174,7 +172,6 @@ async def test_should_include_configured_tls_parameters_on_update(
174172
],
175173
)
176174

177-
@pytest.mark.asyncio()
178175
async def test_should_call_run_command_method_when_helm_install_with_non_defaults(
179176
self, helm: Helm, run_command_async: AsyncMock
180177
):
@@ -219,7 +216,6 @@ async def test_should_call_run_command_method_when_helm_install_with_non_default
219216
],
220217
)
221218

222-
@pytest.mark.asyncio()
223219
async def test_should_call_run_command_method_when_uninstalling_streams_app(
224220
self, helm: Helm, run_command_async: AsyncMock
225221
):
@@ -232,7 +228,6 @@ async def test_should_call_run_command_method_when_uninstalling_streams_app(
232228
["helm", "uninstall", "test-release", "--namespace", "test-namespace"],
233229
)
234230

235-
@pytest.mark.asyncio()
236231
async def test_should_log_warning_when_release_not_found(
237232
self,
238233
run_command_async: AsyncMock,
@@ -250,7 +245,6 @@ async def test_should_log_warning_when_release_not_found(
250245
"Release with name test-release not found. Could not uninstall app."
251246
)
252247

253-
@pytest.mark.asyncio()
254248
async def test_should_call_run_command_method_when_installing_streams_app__with_dry_run(
255249
self, helm: Helm, run_command_async: AsyncMock
256250
):

tests/component_handlers/kafka_connect/test_connect_handler.py

-10
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ def connector_config(self) -> KafkaConnectorConfig:
6161
name=CONNECTOR_NAME,
6262
)
6363

64-
@pytest.mark.asyncio()
6564
async def test_should_create_connector_in_dry_run(
6665
self,
6766
connector_config: KafkaConnectorConfig,
@@ -87,7 +86,6 @@ async def test_should_create_connector_in_dry_run(
8786
),
8887
]
8988

90-
@pytest.mark.asyncio()
9189
async def test_should_log_correct_message_when_create_connector_and_connector_not_exists_in_dry_run(
9290
self, log_info_mock: MagicMock, connector_wrapper: AsyncMock
9391
):
@@ -116,7 +114,6 @@ async def test_should_log_correct_message_when_create_connector_and_connector_no
116114
),
117115
]
118116

119-
@pytest.mark.asyncio()
120117
async def test_should_log_correct_message_when_create_connector_and_connector_exists_in_dry_run(
121118
self, log_info_mock: MagicMock, connector_wrapper: AsyncMock
122119
):
@@ -162,7 +159,6 @@ async def test_should_log_correct_message_when_create_connector_and_connector_ex
162159
),
163160
]
164161

165-
@pytest.mark.asyncio()
166162
async def test_should_log_invalid_config_when_create_connector_in_dry_run(
167163
self, connector_config: KafkaConnectorConfig, renderer_diff_mock: MagicMock
168164
):
@@ -187,7 +183,6 @@ async def test_should_log_invalid_config_when_create_connector_in_dry_run(
187183
connector_config
188184
)
189185

190-
@pytest.mark.asyncio()
191186
async def test_should_call_update_connector_config_when_connector_exists_not_dry_run(
192187
self, connector_config: KafkaConnectorConfig
193188
):
@@ -202,7 +197,6 @@ async def test_should_call_update_connector_config_when_connector_exists_not_dry
202197
mock.call.update_connector_config(connector_config),
203198
]
204199

205-
@pytest.mark.asyncio()
206200
async def test_should_call_create_connector_when_connector_does_not_exists_not_dry_run(
207201
self, connector_config: KafkaConnectorConfig
208202
):
@@ -216,7 +210,6 @@ async def test_should_call_create_connector_when_connector_does_not_exists_not_d
216210

217211
connector_wrapper.create_connector.assert_called_once_with(connector_config)
218212

219-
@pytest.mark.asyncio()
220213
async def test_should_print_correct_log_when_destroying_connector_in_dry_run(
221214
self, log_info_mock: MagicMock, connector_wrapper: AsyncMock
222215
):
@@ -230,7 +223,6 @@ async def test_should_print_correct_log_when_destroying_connector_in_dry_run(
230223
)
231224
)
232225

233-
@pytest.mark.asyncio()
234226
async def test_should_print_correct_warning_log_when_destroying_connector_and_connector_exists_in_dry_run(
235227
self, log_warning_mock: MagicMock, connector_wrapper: AsyncMock
236228
):
@@ -246,7 +238,6 @@ async def test_should_print_correct_warning_log_when_destroying_connector_and_co
246238
f"Connector Destruction: connector {CONNECTOR_NAME} does not exist and cannot be deleted. Skipping."
247239
)
248240

249-
@pytest.mark.asyncio()
250241
async def test_should_call_delete_connector_when_destroying_existing_connector_not_dry_run(
251242
self, connector_wrapper: AsyncMock
252243
):
@@ -259,7 +250,6 @@ async def test_should_call_delete_connector_when_destroying_existing_connector_n
259250
mock.call.delete_connector(CONNECTOR_NAME),
260251
]
261252

262-
@pytest.mark.asyncio()
263253
async def test_should_print_correct_warning_log_when_destroying_connector_and_connector_exists_not_dry_run(
264254
self, log_warning_mock: MagicMock, connector_wrapper: AsyncMock
265255
):

tests/component_handlers/kafka_connect/test_connect_wrapper.py

-18
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ def test_convert_config_values_to_str(self):
6464
"topic.tracking.allow.reset": "false",
6565
}
6666

67-
@pytest.mark.asyncio()
6867
@patch("httpx.AsyncClient.post")
6968
async def test_should_create_post_requests_for_given_connector_configuration(
7069
self, mock_post: AsyncMock
@@ -94,7 +93,6 @@ async def test_should_create_post_requests_for_given_connector_configuration(
9493
},
9594
)
9695

97-
@pytest.mark.asyncio()
9896
async def test_should_return_correct_response_when_connector_created(
9997
self, httpx_mock: HTTPXMock, connector_config: KafkaConnectorConfig
10098
):
@@ -131,7 +129,6 @@ async def test_should_return_correct_response_when_connector_created(
131129

132130
assert KafkaConnectResponse(**actual_response) == expected_response
133131

134-
@pytest.mark.asyncio()
135132
@patch("kpops.component_handlers.kafka_connect.connect_wrapper.log.warning")
136133
async def test_should_raise_connector_exists_exception_when_connector_exists(
137134
self,
@@ -156,7 +153,6 @@ async def test_should_raise_connector_exists_exception_when_connector_exists(
156153
"Rebalancing in progress while creating a connector... Retrying..."
157154
)
158155

159-
@pytest.mark.asyncio()
160156
@patch("httpx.AsyncClient.get")
161157
async def test_should_create_correct_get_connector_request(
162158
self, mock_get: AsyncMock
@@ -171,7 +167,6 @@ async def test_should_create_correct_get_connector_request(
171167
)
172168

173169
@pytest.mark.flaky(reruns=5, condition=sys.platform.startswith("win32"))
174-
@pytest.mark.asyncio()
175170
@patch("kpops.component_handlers.kafka_connect.connect_wrapper.log.info")
176171
async def test_should_return_correct_response_when_getting_connector(
177172
self, log_info: MagicMock, httpx_mock: HTTPXMock
@@ -207,7 +202,6 @@ async def test_should_return_correct_response_when_getting_connector(
207202
assert KafkaConnectResponse(**actual_response) == expected_response
208203
log_info.assert_called_once_with(f"Connector {connector_name} exists.")
209204

210-
@pytest.mark.asyncio()
211205
@patch("kpops.component_handlers.kafka_connect.connect_wrapper.log.info")
212206
async def test_should_raise_connector_not_found_when_getting_connector(
213207
self, log_info: MagicMock, httpx_mock: HTTPXMock
@@ -228,7 +222,6 @@ async def test_should_raise_connector_not_found_when_getting_connector(
228222
f"The named connector {connector_name} does not exists."
229223
)
230224

231-
@pytest.mark.asyncio()
232225
@patch("kpops.component_handlers.kafka_connect.connect_wrapper.log.warning")
233226
async def test_should_raise_rebalance_in_progress_when_getting_connector(
234227
self, log_warning: MagicMock, httpx_mock: HTTPXMock
@@ -252,7 +245,6 @@ async def test_should_raise_rebalance_in_progress_when_getting_connector(
252245
"Rebalancing in progress while getting a connector... Retrying..."
253246
)
254247

255-
@pytest.mark.asyncio()
256248
@patch("httpx.AsyncClient.put")
257249
async def test_should_create_correct_update_connector_request(
258250
self, mock_put: AsyncMock
@@ -279,7 +271,6 @@ async def test_should_create_correct_update_connector_request(
279271
json=KafkaConnectorConfig.model_validate(configs).model_dump(),
280272
)
281273

282-
@pytest.mark.asyncio()
283274
@patch("kpops.component_handlers.kafka_connect.connect_wrapper.log.info")
284275
async def test_should_return_correct_response_when_update_connector(
285276
self,
@@ -323,7 +314,6 @@ async def test_should_return_correct_response_when_update_connector(
323314
f"Config for connector {connector_name} updated."
324315
)
325316

326-
@pytest.mark.asyncio()
327317
@patch("kpops.component_handlers.kafka_connect.connect_wrapper.log.info")
328318
async def test_should_return_correct_response_when_update_connector_created(
329319
self,
@@ -364,7 +354,6 @@ async def test_should_return_correct_response_when_update_connector_created(
364354
assert KafkaConnectResponse(**actual_response) == expected_response
365355
log_info.assert_called_once_with(f"Connector {connector_name} created.")
366356

367-
@pytest.mark.asyncio()
368357
@patch("kpops.component_handlers.kafka_connect.connect_wrapper.log.warning")
369358
async def test_should_raise_connector_exists_exception_when_update_connector(
370359
self,
@@ -391,7 +380,6 @@ async def test_should_raise_connector_exists_exception_when_update_connector(
391380
"Rebalancing in progress while updating a connector... Retrying..."
392381
)
393382

394-
@pytest.mark.asyncio()
395383
@patch("httpx.AsyncClient.delete")
396384
async def test_should_create_correct_delete_connector_request(
397385
self, mock_delete: AsyncMock
@@ -405,7 +393,6 @@ async def test_should_create_correct_delete_connector_request(
405393
headers=HEADERS,
406394
)
407395

408-
@pytest.mark.asyncio()
409396
@patch("kpops.component_handlers.kafka_connect.connect_wrapper.log.info")
410397
async def test_should_return_correct_response_when_deleting_connector(
411398
self, log_info: MagicMock, httpx_mock: HTTPXMock
@@ -441,7 +428,6 @@ async def test_should_return_correct_response_when_deleting_connector(
441428

442429
log_info.assert_called_once_with(f"Connector {connector_name} deleted.")
443430

444-
@pytest.mark.asyncio()
445431
@patch("kpops.component_handlers.kafka_connect.connect_wrapper.log.info")
446432
async def test_should_raise_connector_not_found_when_deleting_connector(
447433
self, log_info: MagicMock, httpx_mock: HTTPXMock
@@ -462,7 +448,6 @@ async def test_should_raise_connector_not_found_when_deleting_connector(
462448
f"The named connector {connector_name} does not exists."
463449
)
464450

465-
@pytest.mark.asyncio()
466451
@patch("kpops.component_handlers.kafka_connect.connect_wrapper.log.warning")
467452
async def test_should_raise_rebalance_in_progress_when_deleting_connector(
468453
self, log_warning: MagicMock, httpx_mock: HTTPXMock
@@ -486,7 +471,6 @@ async def test_should_raise_rebalance_in_progress_when_deleting_connector(
486471
"Rebalancing in progress while deleting a connector... Retrying..."
487472
)
488473

489-
@pytest.mark.asyncio()
490474
@patch("httpx.AsyncClient.put")
491475
async def test_should_create_correct_validate_connector_config_request(
492476
self, mock_put: AsyncMock
@@ -508,7 +492,6 @@ async def test_should_create_correct_validate_connector_config_request(
508492
json=connector_config.model_dump(),
509493
)
510494

511-
@pytest.mark.asyncio()
512495
@patch("httpx.AsyncClient.put")
513496
async def test_should_create_correct_validate_connector_config_and_name_gets_added(
514497
self, mock_put: AsyncMock
@@ -533,7 +516,6 @@ async def test_should_create_correct_validate_connector_config_and_name_gets_add
533516
).model_dump(),
534517
)
535518

536-
@pytest.mark.asyncio()
537519
async def test_should_parse_validate_connector_config(self, httpx_mock: HTTPXMock):
538520
content = await Path(
539521
RESOURCES_PATH / "connect_validation_response.json",

tests/component_handlers/schema_handler/test_schema_handler.py

-7
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ def test_should_raise_value_error_if_schema_provider_class_not_found(
120120
)
121121

122122

123-
@pytest.mark.asyncio()
124123
@pytest.mark.usefixtures("custom_components")
125124
async def test_should_log_info_when_submit_schemas_that_not_exists_and_dry_run_true(
126125
to_section: ToSection,
@@ -140,7 +139,6 @@ async def test_should_log_info_when_submit_schemas_that_not_exists_and_dry_run_t
140139
schema_registry_mock.register.assert_not_called()
141140

142141

143-
@pytest.mark.asyncio()
144142
@pytest.mark.usefixtures("custom_components")
145143
async def test_should_log_info_when_submit_schemas_that_exists_and_dry_run_true(
146144
topic_config: TopicConfig,
@@ -163,7 +161,6 @@ async def test_should_log_info_when_submit_schemas_that_exists_and_dry_run_true(
163161
schema_registry_mock.register.assert_not_called()
164162

165163

166-
@pytest.mark.asyncio()
167164
@pytest.mark.usefixtures("custom_components")
168165
async def test_should_raise_exception_when_submit_schema_that_exists_and_not_compatible_and_dry_run_true(
169166
topic_config: TopicConfig,
@@ -201,7 +198,6 @@ async def test_should_raise_exception_when_submit_schema_that_exists_and_not_com
201198
schema_registry_mock.register.assert_not_called()
202199

203200

204-
@pytest.mark.asyncio()
205201
@pytest.mark.usefixtures("custom_components")
206202
async def test_should_log_debug_when_submit_schema_that_exists_and_registered_under_version_and_dry_run_true(
207203
topic_config: TopicConfig,
@@ -237,7 +233,6 @@ async def test_should_log_debug_when_submit_schema_that_exists_and_registered_un
237233
schema_registry_mock.register.assert_not_called()
238234

239235

240-
@pytest.mark.asyncio()
241236
@pytest.mark.usefixtures("custom_components")
242237
async def test_should_submit_non_existing_schema_when_not_dry(
243238
topic_config: TopicConfig,
@@ -266,7 +261,6 @@ async def test_should_submit_non_existing_schema_when_not_dry(
266261
)
267262

268263

269-
@pytest.mark.asyncio()
270264
async def test_should_log_correct_message_when_delete_schemas_and_in_dry_run(
271265
to_section: ToSection,
272266
log_info_mock: MagicMock,
@@ -286,7 +280,6 @@ async def test_should_log_correct_message_when_delete_schemas_and_in_dry_run(
286280
schema_registry_mock.delete_subject.assert_not_called()
287281

288282

289-
@pytest.mark.asyncio()
290283
async def test_should_delete_schemas_when_not_in_dry_run(
291284
to_section: ToSection,
292285
schema_registry_mock: AsyncMock,

0 commit comments

Comments
 (0)