Skip to content

Commit

Permalink
fix tests hopefully
Browse files Browse the repository at this point in the history
  • Loading branch information
szokeasaurusrex committed Jul 10, 2024
1 parent f529ed6 commit 8d4df26
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
7 changes: 7 additions & 0 deletions tests/new_scopes_compat/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"""
Separate module for tests that check backwards compatibility of the Hub API with 1.x.
These tests should be removed once we remove the Hub API, likely in the next major.
All tests in this module are run with hub isolation, provided by `isolate_hub` autouse
fixture, defined in `conftest.py`.
"""
8 changes: 8 additions & 0 deletions tests/new_scopes_compat/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import pytest
import sentry_sdk


@pytest.fixture(autouse=True)
def isolate_hub():
with sentry_sdk.Hub(None):
yield
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import pytest

import sentry_sdk
from sentry_sdk.hub import Hub

Expand All @@ -13,12 +11,6 @@
"""


@pytest.fixture(autouse=True)
def isolate_hub():
with sentry_sdk.Hub(None):
yield


def test_configure_scope_sdk1(sentry_init, capture_events):
"""
Mutate data in a `with configure_scope` block.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ def create_expected_error_event(trx, span):
"stacktrace": {
"frames": [
{
"filename": "tests/test_new_scopes_compat_event.py",
"filename": "tests/new_scopes_compat/test_new_scopes_compat_event.py",
"abs_path": mock.ANY,
"function": "_faulty_function",
"module": "tests.test_new_scopes_compat_event",
"module": "tests.new_scopes_compat.test_new_scopes_compat_event",
"lineno": mock.ANY,
"pre_context": [
" return create_expected_transaction_event",
Expand Down

0 comments on commit 8d4df26

Please sign in to comment.