Skip to content

Commit

Permalink
test(client): Avoid configure_scope (getsentry#3350)
Browse files Browse the repository at this point in the history
Replace the only `configure_scope` usage in `test_client.py`, which
can be replaced without defeating the test's purpose, with
`Scope.get_isolation_scope`. The other `configure_scope` calls are
made either from a test which specifically tests `configure_scope`
or from a test which is always skipped.

Closes: getsentry#3344
  • Loading branch information
szokeasaurusrex authored and arjenzorgdoc committed Sep 30, 2024
1 parent d40bc9f commit ab80f4e
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -686,14 +686,13 @@ def test_cyclic_data(sentry_init, capture_events):
sentry_init()
events = capture_events()

with configure_scope() as scope:
data = {}
data["is_cyclic"] = data
data = {}
data["is_cyclic"] = data

other_data = ""
data["not_cyclic"] = other_data
data["not_cyclic2"] = other_data
scope.set_extra("foo", data)
other_data = ""
data["not_cyclic"] = other_data
data["not_cyclic2"] = other_data
sentry_sdk.Scope.get_isolation_scope().set_extra("foo", data)

capture_message("hi")
(event,) = events
Expand Down

0 comments on commit ab80f4e

Please sign in to comment.