From 2f0d7be682676f424e4529226c7c057200ce823c Mon Sep 17 00:00:00 2001 From: seyoon-lim Date: Thu, 8 Aug 2024 09:20:56 +0900 Subject: [PATCH] Fix: removed useless mocking on test code --- tests/integrations/spark/test_spark.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/tests/integrations/spark/test_spark.py b/tests/integrations/spark/test_spark.py index 3664ca3c4a..6146c4714c 100644 --- a/tests/integrations/spark/test_spark.py +++ b/tests/integrations/spark/test_spark.py @@ -48,29 +48,25 @@ def test_start_sentry_listener(create_spark_context): assert gateway._callback_server is not None -def test_initialize_spark_integration( - sentry_init, create_spark_context, reset_integrations -): +def test_initialize_spark_integration(sentry_init, create_spark_context): sentry_init(integrations=[SparkIntegration()]) create_spark_context() -@patch("sentry_sdk.integrations.spark.spark_driver._patch_spark_context_init") +@patch("sentry_sdk.integrations.spark.spark_driver._activate_integration") def test_initialize_spark_integration_before_spark_context_init( - mock_patch_spark_context_init, + mock_activate_integration, sentry_init, create_spark_context, ): sentry_init(integrations=[SparkIntegration()]) create_spark_context() - mock_patch_spark_context_init.assert_called_once() + mock_activate_integration.assert_called_once() @patch("sentry_sdk.integrations.spark.spark_driver._activate_integration") -@patch("sentry_sdk.integrations.spark.spark_driver._patch_spark_context_init") def test_initialize_spark_integration_after_spark_context_init( - mock_patch_spark_context_init, mock_activate_integration, create_spark_context, sentry_init, @@ -79,7 +75,6 @@ def test_initialize_spark_integration_after_spark_context_init( sentry_init(integrations=[SparkIntegration()]) mock_activate_integration.assert_called_once() - mock_patch_spark_context_init.assert_not_called() @pytest.fixture