From d38a08293fc4ac97bc230cd28d283123aa89ae73 Mon Sep 17 00:00:00 2001 From: Salomon Popp Date: Thu, 9 Jan 2025 16:44:00 +0100 Subject: [PATCH] Remove `@pytest.mark.asyncio` decorator --- .../helm_wrapper/test_helm_wrapper.py | 6 ------ .../kafka_connect/test_connect_handler.py | 10 ---------- .../kafka_connect/test_connect_wrapper.py | 18 ------------------ .../schema_handler/test_schema_handler.py | 7 ------- .../topic/test_proxy_wrapper.py | 11 ----------- .../topic/test_topic_handler.py | 16 ---------------- .../streams_bootstrap/test_producer_app.py | 7 ------- .../streams_bootstrap/test_streams_app.py | 10 ---------- .../test_streams_bootstrap.py | 3 --- .../streams_bootstrap_v2/test_producer_app.py | 7 ------- .../streams_bootstrap_v2/test_streams_app.py | 10 ---------- .../test_streams_bootstrap.py | 2 -- tests/components/test_helm_app.py | 7 ------- tests/components/test_kafka_sink_connector.py | 8 -------- .../components/test_kafka_source_connector.py | 8 -------- tests/kubernetes/test_pvc_handler.py | 4 ---- tests/pipeline/test_generate.py | 3 --- 17 files changed, 137 deletions(-) diff --git a/tests/component_handlers/helm_wrapper/test_helm_wrapper.py b/tests/component_handlers/helm_wrapper/test_helm_wrapper.py index 3d80e59b2..dfdacd97c 100644 --- a/tests/component_handlers/helm_wrapper/test_helm_wrapper.py +++ b/tests/component_handlers/helm_wrapper/test_helm_wrapper.py @@ -52,7 +52,6 @@ def mock_get_version(self, mocker: MockerFixture) -> MagicMock: def helm(self, mock_get_version: MagicMock) -> Helm: return Helm(helm_config=HelmConfig()) - @pytest.mark.asyncio() async def test_should_call_run_command_method_when_helm_install_with_defaults( self, helm: Helm, run_command_async: AsyncMock ): @@ -138,7 +137,6 @@ def test_should_include_configured_tls_parameters_on_add_when_version_is_new( ), ] - @pytest.mark.asyncio() async def test_should_include_configured_tls_parameters_on_update( self, helm: Helm, run_command_async: AsyncMock ): @@ -174,7 +172,6 @@ async def test_should_include_configured_tls_parameters_on_update( ], ) - @pytest.mark.asyncio() async def test_should_call_run_command_method_when_helm_install_with_non_defaults( self, helm: Helm, run_command_async: AsyncMock ): @@ -219,7 +216,6 @@ async def test_should_call_run_command_method_when_helm_install_with_non_default ], ) - @pytest.mark.asyncio() async def test_should_call_run_command_method_when_uninstalling_streams_app( self, helm: Helm, run_command_async: AsyncMock ): @@ -232,7 +228,6 @@ async def test_should_call_run_command_method_when_uninstalling_streams_app( ["helm", "uninstall", "test-release", "--namespace", "test-namespace"], ) - @pytest.mark.asyncio() async def test_should_log_warning_when_release_not_found( self, run_command_async: AsyncMock, @@ -250,7 +245,6 @@ async def test_should_log_warning_when_release_not_found( "Release with name test-release not found. Could not uninstall app." ) - @pytest.mark.asyncio() async def test_should_call_run_command_method_when_installing_streams_app__with_dry_run( self, helm: Helm, run_command_async: AsyncMock ): diff --git a/tests/component_handlers/kafka_connect/test_connect_handler.py b/tests/component_handlers/kafka_connect/test_connect_handler.py index 83ce7ae35..332d0ae1e 100644 --- a/tests/component_handlers/kafka_connect/test_connect_handler.py +++ b/tests/component_handlers/kafka_connect/test_connect_handler.py @@ -61,7 +61,6 @@ def connector_config(self) -> KafkaConnectorConfig: name=CONNECTOR_NAME, ) - @pytest.mark.asyncio() async def test_should_create_connector_in_dry_run( self, connector_config: KafkaConnectorConfig, @@ -87,7 +86,6 @@ async def test_should_create_connector_in_dry_run( ), ] - @pytest.mark.asyncio() async def test_should_log_correct_message_when_create_connector_and_connector_not_exists_in_dry_run( self, log_info_mock: MagicMock, connector_wrapper: AsyncMock ): @@ -116,7 +114,6 @@ async def test_should_log_correct_message_when_create_connector_and_connector_no ), ] - @pytest.mark.asyncio() async def test_should_log_correct_message_when_create_connector_and_connector_exists_in_dry_run( self, log_info_mock: MagicMock, connector_wrapper: AsyncMock ): @@ -162,7 +159,6 @@ async def test_should_log_correct_message_when_create_connector_and_connector_ex ), ] - @pytest.mark.asyncio() async def test_should_log_invalid_config_when_create_connector_in_dry_run( self, connector_config: KafkaConnectorConfig, renderer_diff_mock: MagicMock ): @@ -187,7 +183,6 @@ async def test_should_log_invalid_config_when_create_connector_in_dry_run( connector_config ) - @pytest.mark.asyncio() async def test_should_call_update_connector_config_when_connector_exists_not_dry_run( self, connector_config: KafkaConnectorConfig ): @@ -202,7 +197,6 @@ async def test_should_call_update_connector_config_when_connector_exists_not_dry mock.call.update_connector_config(connector_config), ] - @pytest.mark.asyncio() async def test_should_call_create_connector_when_connector_does_not_exists_not_dry_run( self, connector_config: KafkaConnectorConfig ): @@ -216,7 +210,6 @@ async def test_should_call_create_connector_when_connector_does_not_exists_not_d connector_wrapper.create_connector.assert_called_once_with(connector_config) - @pytest.mark.asyncio() async def test_should_print_correct_log_when_destroying_connector_in_dry_run( self, log_info_mock: MagicMock, connector_wrapper: AsyncMock ): @@ -230,7 +223,6 @@ async def test_should_print_correct_log_when_destroying_connector_in_dry_run( ) ) - @pytest.mark.asyncio() async def test_should_print_correct_warning_log_when_destroying_connector_and_connector_exists_in_dry_run( self, log_warning_mock: MagicMock, connector_wrapper: AsyncMock ): @@ -246,7 +238,6 @@ async def test_should_print_correct_warning_log_when_destroying_connector_and_co f"Connector Destruction: connector {CONNECTOR_NAME} does not exist and cannot be deleted. Skipping." ) - @pytest.mark.asyncio() async def test_should_call_delete_connector_when_destroying_existing_connector_not_dry_run( self, connector_wrapper: AsyncMock ): @@ -259,7 +250,6 @@ async def test_should_call_delete_connector_when_destroying_existing_connector_n mock.call.delete_connector(CONNECTOR_NAME), ] - @pytest.mark.asyncio() async def test_should_print_correct_warning_log_when_destroying_connector_and_connector_exists_not_dry_run( self, log_warning_mock: MagicMock, connector_wrapper: AsyncMock ): diff --git a/tests/component_handlers/kafka_connect/test_connect_wrapper.py b/tests/component_handlers/kafka_connect/test_connect_wrapper.py index b3aafe217..b1253a886 100644 --- a/tests/component_handlers/kafka_connect/test_connect_wrapper.py +++ b/tests/component_handlers/kafka_connect/test_connect_wrapper.py @@ -64,7 +64,6 @@ def test_convert_config_values_to_str(self): "topic.tracking.allow.reset": "false", } - @pytest.mark.asyncio() @patch("httpx.AsyncClient.post") async def test_should_create_post_requests_for_given_connector_configuration( self, mock_post: AsyncMock @@ -94,7 +93,6 @@ async def test_should_create_post_requests_for_given_connector_configuration( }, ) - @pytest.mark.asyncio() async def test_should_return_correct_response_when_connector_created( self, httpx_mock: HTTPXMock, connector_config: KafkaConnectorConfig ): @@ -131,7 +129,6 @@ async def test_should_return_correct_response_when_connector_created( assert KafkaConnectResponse(**actual_response) == expected_response - @pytest.mark.asyncio() @patch("kpops.component_handlers.kafka_connect.connect_wrapper.log.warning") async def test_should_raise_connector_exists_exception_when_connector_exists( self, @@ -156,7 +153,6 @@ async def test_should_raise_connector_exists_exception_when_connector_exists( "Rebalancing in progress while creating a connector... Retrying..." ) - @pytest.mark.asyncio() @patch("httpx.AsyncClient.get") async def test_should_create_correct_get_connector_request( self, mock_get: AsyncMock @@ -171,7 +167,6 @@ async def test_should_create_correct_get_connector_request( ) @pytest.mark.flaky(reruns=5, condition=sys.platform.startswith("win32")) - @pytest.mark.asyncio() @patch("kpops.component_handlers.kafka_connect.connect_wrapper.log.info") async def test_should_return_correct_response_when_getting_connector( self, log_info: MagicMock, httpx_mock: HTTPXMock @@ -207,7 +202,6 @@ async def test_should_return_correct_response_when_getting_connector( assert KafkaConnectResponse(**actual_response) == expected_response log_info.assert_called_once_with(f"Connector {connector_name} exists.") - @pytest.mark.asyncio() @patch("kpops.component_handlers.kafka_connect.connect_wrapper.log.info") async def test_should_raise_connector_not_found_when_getting_connector( self, log_info: MagicMock, httpx_mock: HTTPXMock @@ -228,7 +222,6 @@ async def test_should_raise_connector_not_found_when_getting_connector( f"The named connector {connector_name} does not exists." ) - @pytest.mark.asyncio() @patch("kpops.component_handlers.kafka_connect.connect_wrapper.log.warning") async def test_should_raise_rebalance_in_progress_when_getting_connector( self, log_warning: MagicMock, httpx_mock: HTTPXMock @@ -252,7 +245,6 @@ async def test_should_raise_rebalance_in_progress_when_getting_connector( "Rebalancing in progress while getting a connector... Retrying..." ) - @pytest.mark.asyncio() @patch("httpx.AsyncClient.put") async def test_should_create_correct_update_connector_request( self, mock_put: AsyncMock @@ -279,7 +271,6 @@ async def test_should_create_correct_update_connector_request( json=KafkaConnectorConfig.model_validate(configs).model_dump(), ) - @pytest.mark.asyncio() @patch("kpops.component_handlers.kafka_connect.connect_wrapper.log.info") async def test_should_return_correct_response_when_update_connector( self, @@ -323,7 +314,6 @@ async def test_should_return_correct_response_when_update_connector( f"Config for connector {connector_name} updated." ) - @pytest.mark.asyncio() @patch("kpops.component_handlers.kafka_connect.connect_wrapper.log.info") async def test_should_return_correct_response_when_update_connector_created( self, @@ -364,7 +354,6 @@ async def test_should_return_correct_response_when_update_connector_created( assert KafkaConnectResponse(**actual_response) == expected_response log_info.assert_called_once_with(f"Connector {connector_name} created.") - @pytest.mark.asyncio() @patch("kpops.component_handlers.kafka_connect.connect_wrapper.log.warning") async def test_should_raise_connector_exists_exception_when_update_connector( self, @@ -391,7 +380,6 @@ async def test_should_raise_connector_exists_exception_when_update_connector( "Rebalancing in progress while updating a connector... Retrying..." ) - @pytest.mark.asyncio() @patch("httpx.AsyncClient.delete") async def test_should_create_correct_delete_connector_request( self, mock_delete: AsyncMock @@ -405,7 +393,6 @@ async def test_should_create_correct_delete_connector_request( headers=HEADERS, ) - @pytest.mark.asyncio() @patch("kpops.component_handlers.kafka_connect.connect_wrapper.log.info") async def test_should_return_correct_response_when_deleting_connector( self, log_info: MagicMock, httpx_mock: HTTPXMock @@ -441,7 +428,6 @@ async def test_should_return_correct_response_when_deleting_connector( log_info.assert_called_once_with(f"Connector {connector_name} deleted.") - @pytest.mark.asyncio() @patch("kpops.component_handlers.kafka_connect.connect_wrapper.log.info") async def test_should_raise_connector_not_found_when_deleting_connector( self, log_info: MagicMock, httpx_mock: HTTPXMock @@ -462,7 +448,6 @@ async def test_should_raise_connector_not_found_when_deleting_connector( f"The named connector {connector_name} does not exists." ) - @pytest.mark.asyncio() @patch("kpops.component_handlers.kafka_connect.connect_wrapper.log.warning") async def test_should_raise_rebalance_in_progress_when_deleting_connector( self, log_warning: MagicMock, httpx_mock: HTTPXMock @@ -486,7 +471,6 @@ async def test_should_raise_rebalance_in_progress_when_deleting_connector( "Rebalancing in progress while deleting a connector... Retrying..." ) - @pytest.mark.asyncio() @patch("httpx.AsyncClient.put") async def test_should_create_correct_validate_connector_config_request( self, mock_put: AsyncMock @@ -508,7 +492,6 @@ async def test_should_create_correct_validate_connector_config_request( json=connector_config.model_dump(), ) - @pytest.mark.asyncio() @patch("httpx.AsyncClient.put") async def test_should_create_correct_validate_connector_config_and_name_gets_added( self, mock_put: AsyncMock @@ -533,7 +516,6 @@ async def test_should_create_correct_validate_connector_config_and_name_gets_add ).model_dump(), ) - @pytest.mark.asyncio() async def test_should_parse_validate_connector_config(self, httpx_mock: HTTPXMock): content = await Path( RESOURCES_PATH / "connect_validation_response.json", diff --git a/tests/component_handlers/schema_handler/test_schema_handler.py b/tests/component_handlers/schema_handler/test_schema_handler.py index fb23e225c..fe1038205 100644 --- a/tests/component_handlers/schema_handler/test_schema_handler.py +++ b/tests/component_handlers/schema_handler/test_schema_handler.py @@ -120,7 +120,6 @@ def test_should_raise_value_error_if_schema_provider_class_not_found( ) -@pytest.mark.asyncio() @pytest.mark.usefixtures("custom_components") async def test_should_log_info_when_submit_schemas_that_not_exists_and_dry_run_true( to_section: ToSection, @@ -140,7 +139,6 @@ async def test_should_log_info_when_submit_schemas_that_not_exists_and_dry_run_t schema_registry_mock.register.assert_not_called() -@pytest.mark.asyncio() @pytest.mark.usefixtures("custom_components") async def test_should_log_info_when_submit_schemas_that_exists_and_dry_run_true( topic_config: TopicConfig, @@ -163,7 +161,6 @@ async def test_should_log_info_when_submit_schemas_that_exists_and_dry_run_true( schema_registry_mock.register.assert_not_called() -@pytest.mark.asyncio() @pytest.mark.usefixtures("custom_components") async def test_should_raise_exception_when_submit_schema_that_exists_and_not_compatible_and_dry_run_true( topic_config: TopicConfig, @@ -201,7 +198,6 @@ async def test_should_raise_exception_when_submit_schema_that_exists_and_not_com schema_registry_mock.register.assert_not_called() -@pytest.mark.asyncio() @pytest.mark.usefixtures("custom_components") async def test_should_log_debug_when_submit_schema_that_exists_and_registered_under_version_and_dry_run_true( topic_config: TopicConfig, @@ -237,7 +233,6 @@ async def test_should_log_debug_when_submit_schema_that_exists_and_registered_un schema_registry_mock.register.assert_not_called() -@pytest.mark.asyncio() @pytest.mark.usefixtures("custom_components") async def test_should_submit_non_existing_schema_when_not_dry( topic_config: TopicConfig, @@ -266,7 +261,6 @@ async def test_should_submit_non_existing_schema_when_not_dry( ) -@pytest.mark.asyncio() async def test_should_log_correct_message_when_delete_schemas_and_in_dry_run( to_section: ToSection, log_info_mock: MagicMock, @@ -286,7 +280,6 @@ async def test_should_log_correct_message_when_delete_schemas_and_in_dry_run( schema_registry_mock.delete_subject.assert_not_called() -@pytest.mark.asyncio() async def test_should_delete_schemas_when_not_in_dry_run( to_section: ToSection, schema_registry_mock: AsyncMock, diff --git a/tests/component_handlers/topic/test_proxy_wrapper.py b/tests/component_handlers/topic/test_proxy_wrapper.py index f5cede799..2f93e0adf 100644 --- a/tests/component_handlers/topic/test_proxy_wrapper.py +++ b/tests/component_handlers/topic/test_proxy_wrapper.py @@ -49,7 +49,6 @@ async def _setup(self, httpx_mock: HTTPXMock): assert self.proxy_wrapper.url == AnyHttpUrl(DEFAULT_HOST) assert self.proxy_wrapper.cluster_id == "cluster-1" - @pytest.mark.asyncio() @patch("httpx.AsyncClient.post") async def test_should_create_topic_with_all_topic_configuration( self, mock_post: AsyncMock @@ -73,7 +72,6 @@ async def test_should_create_topic_with_all_topic_configuration( json=topic_spec, ) - @pytest.mark.asyncio() @patch("httpx.AsyncClient.post") async def test_should_create_topic_with_no_configuration( self, mock_post: AsyncMock @@ -89,7 +87,6 @@ async def test_should_create_topic_with_no_configuration( json=topic_spec, ) - @pytest.mark.asyncio() @patch("httpx.AsyncClient.get") async def test_should_call_get_topic(self, mock_get: AsyncMock): topic_name = "topic-X" @@ -102,7 +99,6 @@ async def test_should_call_get_topic(self, mock_get: AsyncMock): headers=HEADERS, ) - @pytest.mark.asyncio() @patch("httpx.AsyncClient.post") async def test_should_call_batch_alter_topic_config(self, mock_put: AsyncMock): topic_name = "topic-X" @@ -127,7 +123,6 @@ async def test_should_call_batch_alter_topic_config(self, mock_put: AsyncMock): }, ) - @pytest.mark.asyncio() @patch("httpx.AsyncClient.delete") async def test_should_call_delete_topic(self, mock_delete: AsyncMock): topic_name = "topic-X" @@ -140,7 +135,6 @@ async def test_should_call_delete_topic(self, mock_delete: AsyncMock): headers=HEADERS, ) - @pytest.mark.asyncio() @patch("httpx.AsyncClient.get") async def test_should_call_get_broker_config(self, mock_get: AsyncMock): with pytest.raises(KafkaRestProxyError): @@ -151,7 +145,6 @@ async def test_should_call_get_broker_config(self, mock_get: AsyncMock): headers=HEADERS, ) - @pytest.mark.asyncio() async def test_should_log_topic_creation( self, log_info_mock: MagicMock, httpx_mock: HTTPXMock ): @@ -175,7 +168,6 @@ async def test_should_log_topic_creation( await self.proxy_wrapper.create_topic(topic_spec=TopicSpec(**topic_spec)) log_info_mock.assert_called_once_with("Topic topic-X created.") - @pytest.mark.asyncio() async def test_should_log_topic_deletion( self, log_info_mock: MagicMock, httpx_mock: HTTPXMock ): @@ -190,7 +182,6 @@ async def test_should_log_topic_deletion( await self.proxy_wrapper.delete_topic(topic_name=topic_name) log_info_mock.assert_called_once_with("Topic topic-X deleted.") - @pytest.mark.asyncio() async def test_should_get_topic( self, log_debug_mock: MagicMock, httpx_mock: HTTPXMock ): @@ -226,7 +217,6 @@ async def test_should_get_topic( log_debug_mock.assert_any_call("Topic topic-X found.") assert get_topic_response == topic_response - @pytest.mark.asyncio() async def test_should_rais_topic_not_found_exception_get_topic( self, log_debug_mock: MagicMock, httpx_mock: HTTPXMock ): @@ -246,7 +236,6 @@ async def test_should_rais_topic_not_found_exception_get_topic( await self.proxy_wrapper.get_topic(topic_name=topic_name) log_debug_mock.assert_any_call("Topic topic-X not found.") - @pytest.mark.asyncio() async def test_should_log_reset_default_topic_config_when_deleted( self, log_info_mock: MagicMock, httpx_mock: HTTPXMock ): diff --git a/tests/component_handlers/topic/test_topic_handler.py b/tests/component_handlers/topic/test_topic_handler.py index ff924084c..098df90ee 100644 --- a/tests/component_handlers/topic/test_topic_handler.py +++ b/tests/component_handlers/topic/test_topic_handler.py @@ -113,7 +113,6 @@ def test_convert_config_values_to_str(self): "value_schema": None, } - @pytest.mark.asyncio() async def test_should_call_create_topic_with_dry_run_false(self): wrapper = AsyncMock() wrapper.get_topic.side_effect = TopicNotFoundException() @@ -141,7 +140,6 @@ async def test_should_call_create_topic_with_dry_run_false(self): wrapper.create_topic.assert_called_once_with(TopicSpec(**topic_spec)) wrapper.__dry_run_topic_creation.assert_not_called() - @pytest.mark.asyncio() async def test_should_call_update_topic_config_when_topic_exists_and_with_dry_run_false( self, get_topic_response_mock: MagicMock ): @@ -167,7 +165,6 @@ async def test_should_call_update_topic_config_when_topic_exists_and_with_dry_ru ) wrapper.__dry_run_topic_creation.assert_not_called() - @pytest.mark.asyncio() async def test_should_update_topic_config_when_one_config_changed( self, log_info_mock: MagicMock, get_topic_response_mock: MagicMock ): @@ -189,7 +186,6 @@ async def test_should_update_topic_config_when_one_config_changed( [{"name": "cleanup.policy", "value": "delete"}], ) - @pytest.mark.asyncio() async def test_should_not_update_topic_config_when_config_not_changed( self, log_info_mock: MagicMock, get_topic_response_mock: MagicMock ): @@ -211,7 +207,6 @@ async def test_should_not_update_topic_config_when_config_not_changed( "Topic Creation: config of topic topic-X didn't change. Skipping update." ) - @pytest.mark.asyncio() async def test_should_not_update_topic_config_when_config_not_changed_and_not_ordered( self, log_info_mock: MagicMock, get_topic_response_mock: MagicMock ): @@ -232,7 +227,6 @@ async def test_should_not_update_topic_config_when_config_not_changed_and_not_or "Topic Creation: config of topic topic-X didn't change. Skipping update." ) - @pytest.mark.asyncio() async def test_should_call_reset_topic_config_when_topic_exists_dry_run_false_and_topic_configs_change( self, get_topic_response_mock: MagicMock ): @@ -255,7 +249,6 @@ async def test_should_call_reset_topic_config_when_topic_exists_dry_run_false_an ) wrapper.__dry_run_topic_creation.assert_not_called() - @pytest.mark.asyncio() async def test_should_not_call_create_topics_with_dry_run_true_and_topic_not_exists( self, ): @@ -274,7 +267,6 @@ async def test_should_not_call_create_topics_with_dry_run_true_and_topic_not_exi wrapper.create_topic.assert_not_called() - @pytest.mark.asyncio() async def test_should_print_message_with_dry_run_true_and_topic_not_exists( self, log_info_mock: MagicMock ): @@ -299,7 +291,6 @@ async def test_should_print_message_with_dry_run_true_and_topic_not_exists( ) ) - @pytest.mark.asyncio() async def test_should_print_message_if_dry_run_and_topic_exists_with_same_partition_count_and_replication_factor( self, log_info_mock: MagicMock, @@ -336,7 +327,6 @@ async def test_should_print_message_if_dry_run_and_topic_exists_with_same_partit ), ] - @pytest.mark.asyncio() async def test_should_print_message_if_dry_run_and_topic_exists_with_default_partition_count_and_replication_factor( self, log_info_mock: MagicMock, @@ -375,7 +365,6 @@ async def test_should_print_message_if_dry_run_and_topic_exists_with_default_par ), ] - @pytest.mark.asyncio() async def test_should_exit_if_dry_run_and_topic_exists_different_partition_count( self, get_topic_response_mock: MagicMock ): @@ -398,7 +387,6 @@ async def test_should_exit_if_dry_run_and_topic_exists_different_partition_count await topic_handler.create_topic(topic, dry_run=True) wrapper.get_topic_config.assert_called_once() # dry run requests the config to create the diff - @pytest.mark.asyncio() async def test_should_exit_if_dry_run_and_topic_exists_different_replication_factor( self, get_topic_response_mock: MagicMock ): @@ -421,7 +409,6 @@ async def test_should_exit_if_dry_run_and_topic_exists_different_replication_fac await topic_handler.create_topic(topic, dry_run=True) wrapper.get_topic_config.assert_called_once() # dry run requests the config to create the diff - @pytest.mark.asyncio() async def test_should_log_correct_message_when_delete_existing_topic_dry_run( self, log_info_mock: MagicMock, get_topic_response_mock: MagicMock ): @@ -445,7 +432,6 @@ async def test_should_log_correct_message_when_delete_existing_topic_dry_run( ) ) - @pytest.mark.asyncio() async def test_should_log_correct_message_when_delete_non_existing_topic_dry_run( self, log_warning_mock: MagicMock ): @@ -468,7 +454,6 @@ async def test_should_log_correct_message_when_delete_non_existing_topic_dry_run "Topic Deletion: topic topic-X does not exist in the cluster and cannot be deleted. Skipping." ) - @pytest.mark.asyncio() async def test_should_call_delete_topic_not_dry_run(self): wrapper = AsyncMock() topic_handler = TopicHandler(proxy_wrapper=wrapper) @@ -487,7 +472,6 @@ async def test_should_call_delete_topic_not_dry_run(self): mock.call.delete_topic("topic-X"), ] - @pytest.mark.asyncio() async def test_should_print_correct_warning_when_deleting_topic_that_does_not_exists_not_dry_run( self, log_warning_mock: MagicMock ): diff --git a/tests/components/streams_bootstrap/test_producer_app.py b/tests/components/streams_bootstrap/test_producer_app.py index 96dc89df4..014b8e5d3 100644 --- a/tests/components/streams_bootstrap/test_producer_app.py +++ b/tests/components/streams_bootstrap/test_producer_app.py @@ -154,7 +154,6 @@ def test_output_topics(self): "first-extra-topic": KafkaTopic(name="extra-topic-1") } - @pytest.mark.asyncio() async def test_deploy_order_when_dry_run_is_false( self, producer_app: ProducerApp, @@ -206,7 +205,6 @@ async def test_deploy_order_when_dry_run_is_false( ), ] - @pytest.mark.asyncio() async def test_destroy( self, producer_app: ProducerApp, @@ -220,7 +218,6 @@ async def test_destroy( "test-namespace", PRODUCER_APP_RELEASE_NAME, True ) - @pytest.mark.asyncio() async def test_should_clean_producer_app( self, producer_app: ProducerApp, @@ -299,7 +296,6 @@ async def test_should_clean_producer_app( ] ) - @pytest.mark.asyncio() async def test_should_clean_producer_app_and_deploy_clean_up_job_and_delete_clean_up_with_dry_run_false( self, mocker: MockerFixture, @@ -405,7 +401,6 @@ def test_get_output_topics(self): KafkaTopic(name="extra-topic-1"), ] - @pytest.mark.asyncio() async def test_should_not_deploy_clean_up_when_rest(self, mocker: MockerFixture): image_tag_in_cluster = "1.1.1" mocker.patch.object( @@ -454,7 +449,6 @@ async def test_should_not_deploy_clean_up_when_rest(self, mocker: MockerFixture) ) mock_helm_upgrade_install_clean_up.assert_not_called() - @pytest.mark.asyncio() async def test_should_deploy_clean_up_job_with_values_in_cluster_when_clean( self, mocker: MockerFixture ): @@ -520,7 +514,6 @@ async def test_should_deploy_clean_up_job_with_values_in_cluster_when_clean( HelmUpgradeInstallFlags(version="3.1.0", wait=True, wait_for_jobs=True), ) - @pytest.mark.asyncio() async def test_clean_should_fall_back_to_local_values_when_validation_of_cluster_values_fails( self, mocker: MockerFixture, caplog: pytest.LogCaptureFixture ): diff --git a/tests/components/streams_bootstrap/test_streams_app.py b/tests/components/streams_bootstrap/test_streams_app.py index ec4b8ef4e..254398081 100644 --- a/tests/components/streams_bootstrap/test_streams_app.py +++ b/tests/components/streams_bootstrap/test_streams_app.py @@ -337,7 +337,6 @@ def test_weave_inputs_from_prev_component(self): KafkaTopic(name="a"), ] - @pytest.mark.asyncio() async def test_deploy_order_when_dry_run_is_false(self, mocker: MockerFixture): streams_app = StreamsApp( name=STREAMS_APP_NAME, @@ -450,7 +449,6 @@ async def test_deploy_order_when_dry_run_is_false(self, mocker: MockerFixture): ), ] - @pytest.mark.asyncio() async def test_destroy( self, streams_app: StreamsApp, @@ -464,7 +462,6 @@ async def test_destroy( "test-namespace", STREAMS_APP_RELEASE_NAME, True ) - @pytest.mark.asyncio() async def test_reset_when_dry_run_is_false( self, streams_app: StreamsApp, @@ -532,7 +529,6 @@ async def test_reset_when_dry_run_is_false( ] ) - @pytest.mark.asyncio() async def test_should_clean_streams_app_and_deploy_clean_up_job_and_delete_clean_up( self, streams_app: StreamsApp, @@ -599,7 +595,6 @@ async def test_should_clean_streams_app_and_deploy_clean_up_job_and_delete_clean ] ) - @pytest.mark.asyncio() async def test_should_deploy_clean_up_job_with_values_in_cluster_when_reset( self, mocker: MockerFixture ): @@ -679,7 +674,6 @@ async def test_should_deploy_clean_up_job_with_values_in_cluster_when_reset( HelmUpgradeInstallFlags(version="3.1.0", wait=True, wait_for_jobs=True), ) - @pytest.mark.asyncio() async def test_should_deploy_clean_up_job_with_values_in_cluster_when_clean( self, mocker: MockerFixture ): @@ -759,7 +753,6 @@ async def test_should_deploy_clean_up_job_with_values_in_cluster_when_clean( HelmUpgradeInstallFlags(version="3.1.0", wait=True, wait_for_jobs=True), ) - @pytest.mark.asyncio() async def test_get_input_output_topics(self): streams_app = StreamsApp( name="my-app", @@ -866,7 +859,6 @@ async def async_generator_side_effect() -> AsyncIterator[PersistentVolumeClaim]: PVCHandler, "list_pvcs", side_effect=async_generator_side_effect ) - @pytest.mark.asyncio() @pytest.mark.usefixtures("kubeconfig") async def test_stateful_clean_with_dry_run_false( self, @@ -941,7 +933,6 @@ async def test_stateful_clean_with_dry_run_false( ] ) - @pytest.mark.asyncio() @pytest.mark.usefixtures("kubeconfig") async def test_stateful_clean_with_dry_run_true( self, @@ -970,7 +961,6 @@ async def test_stateful_clean_with_dry_run_true( in caplog.text ) - @pytest.mark.asyncio() async def test_clean_should_fall_back_to_local_values_when_validation_of_cluster_values_fails( self, mocker: MockerFixture, diff --git a/tests/components/streams_bootstrap/test_streams_bootstrap.py b/tests/components/streams_bootstrap/test_streams_bootstrap.py index de461dc1d..b0b8f0f07 100644 --- a/tests/components/streams_bootstrap/test_streams_bootstrap.py +++ b/tests/components/streams_bootstrap/test_streams_bootstrap.py @@ -45,7 +45,6 @@ def test_default_configs(self): assert streams_bootstrap.namespace == "test-namespace" assert streams_bootstrap.values.image_tag is None - @pytest.mark.asyncio() async def test_should_deploy_streams_bootstrap_app(self, mocker: MockerFixture): streams_bootstrap = StreamsBootstrap( name="example-name", @@ -95,7 +94,6 @@ async def test_should_deploy_streams_bootstrap_app(self, mocker: MockerFixture): HelmUpgradeInstallFlags(version="3.2.1"), ) - @pytest.mark.asyncio() async def test_should_raise_validation_error_for_invalid_image_tag(self): with pytest.raises( ValidationError, @@ -113,7 +111,6 @@ async def test_should_raise_validation_error_for_invalid_image_tag(self): } ) - @pytest.mark.asyncio() async def test_should_raise_validation_error_for_invalid_helm_chart_version(self): with pytest.raises( ValueError, diff --git a/tests/components/streams_bootstrap_v2/test_producer_app.py b/tests/components/streams_bootstrap_v2/test_producer_app.py index 7f4a6922e..afeb91c70 100644 --- a/tests/components/streams_bootstrap_v2/test_producer_app.py +++ b/tests/components/streams_bootstrap_v2/test_producer_app.py @@ -116,7 +116,6 @@ def test_output_topics(self): "first-extra-topic": KafkaTopic(name="extra-topic-1") } - @pytest.mark.asyncio() async def test_deploy_order_when_dry_run_is_false( self, producer_app: ProducerAppV2, @@ -167,7 +166,6 @@ async def test_deploy_order_when_dry_run_is_false( ), ] - @pytest.mark.asyncio() async def test_destroy( self, producer_app: ProducerAppV2, @@ -181,7 +179,6 @@ async def test_destroy( "test-namespace", PRODUCER_APP_RELEASE_NAME, True ) - @pytest.mark.asyncio() async def test_should_clean_producer_app( self, producer_app: ProducerAppV2, @@ -259,7 +256,6 @@ async def test_should_clean_producer_app( ] ) - @pytest.mark.asyncio() async def test_should_clean_producer_app_and_deploy_clean_up_job_and_delete_clean_up_with_dry_run_false( self, mocker: MockerFixture, @@ -363,7 +359,6 @@ def test_get_output_topics(self): KafkaTopic(name="extra-topic-1"), ] - @pytest.mark.asyncio() async def test_should_not_deploy_clean_up_when_rest(self, mocker: MockerFixture): image_tag_in_cluster = "1.1.1" mocker.patch.object( @@ -411,7 +406,6 @@ async def test_should_not_deploy_clean_up_when_rest(self, mocker: MockerFixture) ) mock_helm_upgrade_install_clean_up.assert_not_called() - @pytest.mark.asyncio() async def test_should_deploy_clean_up_job_with_values_in_cluster_when_clean( self, mocker: MockerFixture ): @@ -476,7 +470,6 @@ async def test_should_deploy_clean_up_job_with_values_in_cluster_when_clean( HelmUpgradeInstallFlags(version="2.9.0", wait=True, wait_for_jobs=True), ) - @pytest.mark.asyncio() async def test_clean_should_fall_back_to_local_values_when_validation_of_cluster_values_fails( self, mocker: MockerFixture, caplog: pytest.LogCaptureFixture ): diff --git a/tests/components/streams_bootstrap_v2/test_streams_app.py b/tests/components/streams_bootstrap_v2/test_streams_app.py index 0a4621581..b87736c27 100644 --- a/tests/components/streams_bootstrap_v2/test_streams_app.py +++ b/tests/components/streams_bootstrap_v2/test_streams_app.py @@ -367,7 +367,6 @@ def test_weave_inputs_from_prev_component(self): KafkaTopic(name="a"), ] - @pytest.mark.asyncio() async def test_deploy_order_when_dry_run_is_false(self, mocker: MockerFixture): streams_app = StreamsAppV2( name=STREAMS_APP_NAME, @@ -478,7 +477,6 @@ async def test_deploy_order_when_dry_run_is_false(self, mocker: MockerFixture): ), ] - @pytest.mark.asyncio() async def test_destroy( self, streams_app: StreamsAppV2, @@ -492,7 +490,6 @@ async def test_destroy( "test-namespace", STREAMS_APP_RELEASE_NAME, True ) - @pytest.mark.asyncio() async def test_reset_when_dry_run_is_false( self, streams_app: StreamsAppV2, @@ -559,7 +556,6 @@ async def test_reset_when_dry_run_is_false( ] ) - @pytest.mark.asyncio() async def test_should_clean_streams_app_and_deploy_clean_up_job_and_delete_clean_up( self, streams_app: StreamsAppV2, @@ -625,7 +621,6 @@ async def test_should_clean_streams_app_and_deploy_clean_up_job_and_delete_clean ] ) - @pytest.mark.asyncio() async def test_should_deploy_clean_up_job_with_values_in_cluster_when_reset( self, mocker: MockerFixture ): @@ -704,7 +699,6 @@ async def test_should_deploy_clean_up_job_with_values_in_cluster_when_reset( HelmUpgradeInstallFlags(version="2.9.0", wait=True, wait_for_jobs=True), ) - @pytest.mark.asyncio() async def test_should_deploy_clean_up_job_with_values_in_cluster_when_clean( self, mocker: MockerFixture ): @@ -783,7 +777,6 @@ async def test_should_deploy_clean_up_job_with_values_in_cluster_when_clean( HelmUpgradeInstallFlags(version="2.9.0", wait=True, wait_for_jobs=True), ) - @pytest.mark.asyncio() async def test_get_input_output_topics(self): streams_app = StreamsAppV2( name="my-app", @@ -902,7 +895,6 @@ async def async_generator_side_effect() -> AsyncIterator[PersistentVolumeClaim]: PVCHandler, "list_pvcs", side_effect=async_generator_side_effect ) - @pytest.mark.asyncio() @pytest.mark.usefixtures("kubeconfig") async def test_stateful_clean_with_dry_run_false( self, @@ -976,7 +968,6 @@ async def test_stateful_clean_with_dry_run_false( ] ) - @pytest.mark.asyncio() @pytest.mark.usefixtures("kubeconfig") async def test_stateful_clean_with_dry_run_true( self, @@ -1005,7 +996,6 @@ async def test_stateful_clean_with_dry_run_true( in caplog.text ) - @pytest.mark.asyncio() async def test_clean_should_fall_back_to_local_values_when_validation_of_cluster_values_fails( self, mocker: MockerFixture, diff --git a/tests/components/streams_bootstrap_v2/test_streams_bootstrap.py b/tests/components/streams_bootstrap_v2/test_streams_bootstrap.py index f143e702d..51429fd9e 100644 --- a/tests/components/streams_bootstrap_v2/test_streams_bootstrap.py +++ b/tests/components/streams_bootstrap_v2/test_streams_bootstrap.py @@ -36,7 +36,6 @@ def test_default_configs(self): assert streams_bootstrap.namespace == "test-namespace" assert streams_bootstrap.values.image_tag == "latest" - @pytest.mark.asyncio() async def test_should_deploy_streams_bootstrap_app(self, mocker: MockerFixture): streams_bootstrap = StreamsBootstrapV2.model_validate( { @@ -84,7 +83,6 @@ async def test_should_deploy_streams_bootstrap_app(self, mocker: MockerFixture): HelmUpgradeInstallFlags(version="1.2.3"), ) - @pytest.mark.asyncio() async def test_should_raise_validation_error_for_invalid_image_tag(self): with pytest.raises( ValidationError, diff --git a/tests/components/test_helm_app.py b/tests/components/test_helm_app.py index f72514299..cf188423c 100644 --- a/tests/components/test_helm_app.py +++ b/tests/components/test_helm_app.py @@ -48,7 +48,6 @@ def helm_app( repo_config=repo_config, ) - @pytest.mark.asyncio() async def test_should_lazy_load_helm_wrapper_and_not_repo_add( self, helm_app: HelmApp, @@ -78,7 +77,6 @@ async def test_should_lazy_load_helm_wrapper_and_not_repo_add( HelmUpgradeInstallFlags(), ) - @pytest.mark.asyncio() async def test_should_lazy_load_helm_wrapper_and_call_repo_add_when_implemented( self, helm_mock: MagicMock, @@ -124,7 +122,6 @@ async def test_should_lazy_load_helm_wrapper_and_call_repo_add_when_implemented( ), ] - @pytest.mark.asyncio() async def test_should_deploy_app_with_local_helm_chart( self, helm_mock: MagicMock, @@ -160,7 +157,6 @@ def helm_chart(self) -> str: HelmUpgradeInstallFlags(), ) - @pytest.mark.asyncio() async def test_should_raise_not_implemented_error_when_helm_chart_is_not_set( self, helm_app: HelmApp, @@ -174,7 +170,6 @@ async def test_should_raise_not_implemented_error_when_helm_chart_is_not_set( == "Please implement the helm_chart property of the kpops.components.base_components.helm_app module." ) - @pytest.mark.asyncio() async def test_should_call_helm_uninstall_when_destroying_helm_app( self, helm_app: HelmApp, @@ -192,7 +187,6 @@ async def test_should_call_helm_uninstall_when_destroying_helm_app( log_info_mock.assert_called_once_with(magentaify(stdout)) - @pytest.mark.asyncio() async def test_should_call_helm_uninstall_when_resetting_helm_app( self, helm_app: HelmApp, @@ -210,7 +204,6 @@ async def test_should_call_helm_uninstall_when_resetting_helm_app( log_info_mock.assert_called_once_with(magentaify(stdout)) - @pytest.mark.asyncio() async def test_should_call_helm_uninstall_when_cleaning_helm_app( self, helm_app: HelmApp, diff --git a/tests/components/test_kafka_sink_connector.py b/tests/components/test_kafka_sink_connector.py index 7aa3889fc..f4a2da437 100644 --- a/tests/components/test_kafka_sink_connector.py +++ b/tests/components/test_kafka_sink_connector.py @@ -157,7 +157,6 @@ def test_from_section_parsing_input_pattern( ) assert connector.config.topics_regex == topic_pattern - @pytest.mark.asyncio() async def test_deploy_order( self, connector: KafkaSinkConnector, @@ -185,7 +184,6 @@ async def test_deploy_order( mocker.call.mock_create_connector(connector.config, dry_run=dry_run), ] - @pytest.mark.asyncio() async def test_destroy( self, connector: KafkaSinkConnector, @@ -201,7 +199,6 @@ async def test_destroy( CONNECTOR_FULL_NAME, dry_run=True ) - @pytest.mark.asyncio() async def test_reset_when_dry_run_is_true( self, connector: KafkaSinkConnector, @@ -212,7 +209,6 @@ async def test_reset_when_dry_run_is_true( dry_run_handler_mock.print_helm_diff.assert_called_once() - @pytest.mark.asyncio() async def test_reset_when_dry_run_is_false( self, connector: KafkaSinkConnector, @@ -287,7 +283,6 @@ async def test_reset_when_dry_run_is_false( dry_run_handler_mock.print_helm_diff.assert_not_called() mock_delete_topic.assert_not_called() - @pytest.mark.asyncio() async def test_clean_when_dry_run_is_true( self, connector: KafkaSinkConnector, @@ -298,7 +293,6 @@ async def test_clean_when_dry_run_is_true( await connector.clean(dry_run=dry_run) dry_run_handler_mock.print_helm_diff.assert_called_once() - @pytest.mark.asyncio() async def test_clean_when_dry_run_is_false( self, connector: KafkaSinkConnector, @@ -388,7 +382,6 @@ async def test_clean_when_dry_run_is_false( ] dry_run_handler_mock.print_helm_diff.assert_not_called() - @pytest.mark.asyncio() async def test_clean_without_to_when_dry_run_is_true( self, dry_run_handler_mock: MagicMock, @@ -405,7 +398,6 @@ async def test_clean_without_to_when_dry_run_is_true( await connector.clean(dry_run) dry_run_handler_mock.print_helm_diff.assert_called_once() - @pytest.mark.asyncio() async def test_clean_without_to_when_dry_run_is_false( self, helm_mock: MagicMock, diff --git a/tests/components/test_kafka_source_connector.py b/tests/components/test_kafka_source_connector.py index 796eb0daf..5087a4b2c 100644 --- a/tests/components/test_kafka_source_connector.py +++ b/tests/components/test_kafka_source_connector.py @@ -88,7 +88,6 @@ def test_from_section_raises_exception( ), ) - @pytest.mark.asyncio() async def test_deploy_order( self, connector: KafkaSourceConnector, @@ -117,7 +116,6 @@ async def test_deploy_order( mocker.call.mock_create_connector(connector.config, dry_run=dry_run), ] - @pytest.mark.asyncio() async def test_destroy( self, connector: KafkaSourceConnector, @@ -136,7 +134,6 @@ async def test_destroy( CONNECTOR_FULL_NAME, dry_run=True ) - @pytest.mark.asyncio() async def test_reset_when_dry_run_is_true( self, connector: KafkaSourceConnector, @@ -146,7 +143,6 @@ async def test_reset_when_dry_run_is_true( dry_run_handler_mock.print_helm_diff.assert_called_once() - @pytest.mark.asyncio() async def test_reset_when_dry_run_is_false( self, connector: KafkaSourceConnector, @@ -216,7 +212,6 @@ async def test_reset_when_dry_run_is_false( mock_delete_topic.assert_not_called() dry_run_handler_mock.print_helm_diff.assert_not_called() - @pytest.mark.asyncio() async def test_clean_when_dry_run_is_true( self, connector: KafkaSourceConnector, @@ -226,7 +221,6 @@ async def test_clean_when_dry_run_is_true( dry_run_handler_mock.print_helm_diff.assert_called_once() - @pytest.mark.asyncio() async def test_clean_when_dry_run_is_false( self, connector: KafkaSourceConnector, @@ -302,7 +296,6 @@ async def test_clean_when_dry_run_is_false( dry_run_handler_mock.print_helm_diff.assert_not_called() - @pytest.mark.asyncio() async def test_clean_without_to_when_dry_run_is_false( self, helm_mock: MagicMock, @@ -384,7 +377,6 @@ async def test_clean_without_to_when_dry_run_is_false( mock_delete_topic.assert_not_called() dry_run_handler_mock.print_helm_diff.assert_not_called() - @pytest.mark.asyncio() async def test_clean_without_to_when_dry_run_is_true( self, dry_run_handler_mock: MagicMock, diff --git a/tests/kubernetes/test_pvc_handler.py b/tests/kubernetes/test_pvc_handler.py index dcb717a81..f6bde42ed 100644 --- a/tests/kubernetes/test_pvc_handler.py +++ b/tests/kubernetes/test_pvc_handler.py @@ -68,7 +68,6 @@ async def async_generator_side_effect() -> AsyncIterator[PersistentVolumeClaim]: @pytest.mark.usefixtures("mock_list_pvcs") -@pytest.mark.asyncio async def test_list_pvcs( pvc_handler: PVCHandler, mocker: MockerFixture, @@ -81,7 +80,6 @@ async def test_list_pvcs( @pytest.mark.usefixtures("mock_list_pvcs") -@pytest.mark.asyncio async def test_delete_pvcs_dry_run( pvc_handler: PVCHandler, mocker: MockerFixture, @@ -99,7 +97,6 @@ async def test_delete_pvcs_dry_run( ) -@pytest.mark.asyncio async def test_delete_pvcs_dry_run_no_pvcs( pvc_handler: PVCHandler, mocker: MockerFixture, @@ -121,7 +118,6 @@ async def test_delete_pvcs_dry_run_no_pvcs( @pytest.mark.usefixtures("mock_list_pvcs") -@pytest.mark.asyncio async def test_delete_pvcs( pvc_handler: PVCHandler, mocker: MockerFixture, diff --git a/tests/pipeline/test_generate.py b/tests/pipeline/test_generate.py index 36a6ab355..ac373eb57 100644 --- a/tests/pipeline/test_generate.py +++ b/tests/pipeline/test_generate.py @@ -703,7 +703,6 @@ def test_validate_topic_and_component_same_name(self): assert component == topic.removeprefix("topic-") assert (component, topic) in edges - @pytest.mark.asyncio() async def test_parallel_execution_graph(self): pipeline = kpops.generate( RESOURCE_PATH / "parallel-pipeline" / PIPELINE_YAML, @@ -744,7 +743,6 @@ async def name_runner(component: PipelineComponent): mock.call("s3-connector-1"), ] - @pytest.mark.asyncio() async def test_subgraph_execution(self): pipeline = kpops.generate( RESOURCE_PATH / "parallel-pipeline" / PIPELINE_YAML, @@ -772,7 +770,6 @@ async def name_runner(component: PipelineComponent): mock.call("s3-connector-1"), ] - @pytest.mark.asyncio() async def test_parallel_execution_graph_reverse(self): pipeline = kpops.generate( RESOURCE_PATH / "parallel-pipeline" / PIPELINE_YAML,