Skip to content

Commit 8d4df26

Browse files
fix tests hopefully
1 parent f529ed6 commit 8d4df26

File tree

4 files changed

+17
-10
lines changed

4 files changed

+17
-10
lines changed

tests/new_scopes_compat/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
"""
2+
Separate module for tests that check backwards compatibility of the Hub API with 1.x.
3+
These tests should be removed once we remove the Hub API, likely in the next major.
4+
5+
All tests in this module are run with hub isolation, provided by `isolate_hub` autouse
6+
fixture, defined in `conftest.py`.
7+
"""

tests/new_scopes_compat/conftest.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import pytest
2+
import sentry_sdk
3+
4+
5+
@pytest.fixture(autouse=True)
6+
def isolate_hub():
7+
with sentry_sdk.Hub(None):
8+
yield

tests/test_new_scopes_compat.py renamed to tests/new_scopes_compat/test_new_scopes_compat.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import pytest
2-
31
import sentry_sdk
42
from sentry_sdk.hub import Hub
53

@@ -13,12 +11,6 @@
1311
"""
1412

1513

16-
@pytest.fixture(autouse=True)
17-
def isolate_hub():
18-
with sentry_sdk.Hub(None):
19-
yield
20-
21-
2214
def test_configure_scope_sdk1(sentry_init, capture_events):
2315
"""
2416
Mutate data in a `with configure_scope` block.

tests/test_new_scopes_compat_event.py renamed to tests/new_scopes_compat/test_new_scopes_compat_event.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ def create_expected_error_event(trx, span):
3232
"stacktrace": {
3333
"frames": [
3434
{
35-
"filename": "tests/test_new_scopes_compat_event.py",
35+
"filename": "tests/new_scopes_compat/test_new_scopes_compat_event.py",
3636
"abs_path": mock.ANY,
3737
"function": "_faulty_function",
38-
"module": "tests.test_new_scopes_compat_event",
38+
"module": "tests.new_scopes_compat.test_new_scopes_compat_event",
3939
"lineno": mock.ANY,
4040
"pre_context": [
4141
" return create_expected_transaction_event",

0 commit comments

Comments
 (0)