Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref(tests): Unhardcode integration list #3240

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 16 additions & 22 deletions tests/new_scopes_compat/test_new_scopes_compat_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import sentry_sdk
from sentry_sdk.hub import Hub
from sentry_sdk.integrations import iter_default_integrations
from sentry_sdk.scrubber import EventScrubber, DEFAULT_DENYLIST


Expand All @@ -18,7 +19,17 @@


@pytest.fixture
def expected_error():
def integrations():
return [
integration.identifier
for integration in iter_default_integrations(
with_auto_enabling_integrations=False
)
]


@pytest.fixture
def expected_error(integrations):
def create_expected_error_event(trx, span):
return {
"level": "warning-X",
Expand Down Expand Up @@ -122,16 +133,7 @@ def create_expected_error_event(trx, span):
"name": "sentry.python",
"version": mock.ANY,
"packages": [{"name": "pypi:sentry-sdk", "version": mock.ANY}],
"integrations": [
"argv",
"atexit",
"dedupe",
"excepthook",
"logging",
"modules",
"stdlib",
"threading",
],
"integrations": integrations,
},
"platform": "python",
"_meta": {
Expand All @@ -149,7 +151,7 @@ def create_expected_error_event(trx, span):


@pytest.fixture
def expected_transaction():
def expected_transaction(integrations):
def create_expected_transaction_event(trx, span):
return {
"type": "transaction",
Expand Down Expand Up @@ -220,16 +222,7 @@ def create_expected_transaction_event(trx, span):
"name": "sentry.python",
"version": mock.ANY,
"packages": [{"name": "pypi:sentry-sdk", "version": mock.ANY}],
"integrations": [
"argv",
"atexit",
"dedupe",
"excepthook",
"logging",
"modules",
"stdlib",
"threading",
],
"integrations": integrations,
},
"platform": "python",
"_meta": {
Expand Down Expand Up @@ -328,6 +321,7 @@ def _init_sentry_sdk(sentry_init):
),
send_default_pii=False,
traces_sample_rate=1.0,
auto_enabling_integrations=False,
)


Expand Down
Loading