Skip to content

Commit

Permalink
test(basics): Replace push_scope (getsentry#3353)
Browse files Browse the repository at this point in the history
Most of the `push_scope` usages in `test_basics.py` need to stay, as
they test functionality specific to `push_scope`.

However, in `test_scope_event_processor_order`, the `push_scope` can
be replaced with `new_scope`. We make this replacement here.

Ref: getsentry#3345
  • Loading branch information
szokeasaurusrex authored and arjenzorgdoc committed Sep 30, 2024
1 parent eb1e5de commit 9a33cc4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/test_basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
last_event_id,
add_breadcrumb,
isolation_scope,
new_scope,
Hub,
Scope,
)
Expand Down Expand Up @@ -606,14 +607,14 @@ def before_send(event, hint):
sentry_init(debug=True, before_send=before_send)
events = capture_events()

with push_scope() as scope:
with new_scope() as scope:

@scope.add_event_processor
def foo(event, hint):
event["message"] += "foo"
return event

with push_scope() as scope:
with new_scope() as scope:

@scope.add_event_processor
def bar(event, hint):
Expand Down

0 comments on commit 9a33cc4

Please sign in to comment.