Skip to content

Commit

Permalink
Fix: removed useless mocking on test code
Browse files Browse the repository at this point in the history
  • Loading branch information
seyoon-lim committed Aug 8, 2024
1 parent fd48489 commit 2f0d7be
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions tests/integrations/spark/test_spark.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down

0 comments on commit 2f0d7be

Please sign in to comment.