|
9 | 9 | from sqlalchemy.orm import relationship, sessionmaker
|
10 | 10 | from sqlalchemy import text
|
11 | 11 |
|
12 |
| -from sentry_sdk import capture_message, start_transaction, configure_scope |
| 12 | +from sentry_sdk import capture_message, start_transaction |
13 | 13 | from sentry_sdk.consts import DEFAULT_MAX_VALUE_LENGTH, SPANDATA
|
14 | 14 | from sentry_sdk.integrations.sqlalchemy import SqlalchemyIntegration
|
| 15 | +from sentry_sdk.scope import Scope |
15 | 16 | from sentry_sdk.serializer import MAX_EVENT_BYTES
|
16 | 17 | from sentry_sdk.tracing_utils import record_sql_queries
|
17 | 18 | from sentry_sdk.utils import json_dumps
|
@@ -226,12 +227,12 @@ def test_large_event_not_truncated(sentry_init, capture_events):
|
226 | 227 |
|
227 | 228 | long_str = "x" * (DEFAULT_MAX_VALUE_LENGTH + 10)
|
228 | 229 |
|
229 |
| - with configure_scope() as scope: |
| 230 | + scope = Scope.get_isolation_scope() |
230 | 231 |
|
231 |
| - @scope.add_event_processor |
232 |
| - def processor(event, hint): |
233 |
| - event["message"] = long_str |
234 |
| - return event |
| 232 | + @scope.add_event_processor |
| 233 | + def processor(event, hint): |
| 234 | + event["message"] = long_str |
| 235 | + return event |
235 | 236 |
|
236 | 237 | engine = create_engine("sqlite:///:memory:")
|
237 | 238 | with start_transaction(name="test"):
|
|
0 commit comments