Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(sessions): Replace push_scope #3354

Merged
merged 5 commits into from
Jul 26, 2024

Conversation

szokeasaurusrex
Copy link
Member

All usages of sentry_sdk.push_scope in test_sessions.py can be
replaced with new_scope.

Closes: #3345

@szokeasaurusrex szokeasaurusrex linked an issue Jul 26, 2024 that may be closed by this pull request
Use `Scope.get_isolation_scope` instead.

Ref #3344
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: #3344
Although `configure_scope` was meant to be deprecated since Sentry
SDK 2.0.0, calling `configure_scope` did not raise a deprecation
warning. Now, it does.

Fixes #3346
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: #3345
All usages of `sentry_sdk.push_scope` in `test_sessions.py` can be
replaced with `new_scope`.

Closes: #3345
@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/push_scope-0 branch from 0b60ace to 20ed5b7 Compare July 26, 2024 11:57
@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/push_scope-1 branch from d09b113 to c8e93af Compare July 26, 2024 11:58
@szokeasaurusrex szokeasaurusrex changed the base branch from szokeasaurusrex/push_scope-0 to master July 26, 2024 13:14
@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/push_scope-1 branch from 3483499 to c8e93af Compare July 26, 2024 13:16
Copy link

codecov bot commented Jul 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.78%. Comparing base (cc0ee38) to head (c8e93af).

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3354   +/-   ##
=======================================
  Coverage   79.78%   79.78%           
=======================================
  Files         133      133           
  Lines       14319    14321    +2     
  Branches     3009     3009           
=======================================
+ Hits        11424    11426    +2     
+ Misses       2072     2071    -1     
- Partials      823      824    +1     
Files Coverage Δ
sentry_sdk/api.py 79.20% <100.00%> (+0.33%) ⬆️

... and 6 files with indirect coverage changes

@szokeasaurusrex szokeasaurusrex merged commit c8e93af into master Jul 26, 2024
242 checks passed
@szokeasaurusrex szokeasaurusrex deleted the szokeasaurusrex/push_scope-1 branch July 26, 2024 13:27
@szokeasaurusrex
Copy link
Member Author

To merge this PR stack, I combined multiple PRs into this PR before merging. Each individual commit message references the PR where that commit was reviewed

szokeasaurusrex added a commit that referenced this pull request Aug 8, 2024
We removed this line in #3354 since it is no longer needed, but it was apparently accidentally added back in #3357.
szokeasaurusrex added a commit that referenced this pull request Aug 8, 2024
We removed this line in #3354 since it is no longer needed, but it was apparently accidentally added back in #3357.
sentrivana pushed a commit that referenced this pull request Aug 12, 2024
We removed this line in #3354 since it is no longer needed, but it was apparently accidentally added back in #3357.
arjennienhuis pushed a commit to arjennienhuis/sentry-python that referenced this pull request Sep 30, 2024
All usages of `sentry_sdk.push_scope` in `test_sessions.py` can be
replaced with `new_scope`.

Closes: getsentry#3345
arjennienhuis pushed a commit to arjennienhuis/sentry-python that referenced this pull request Sep 30, 2024
We removed this line in getsentry#3354 since it is no longer needed, but it was apparently accidentally added back in getsentry#3357.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stop using sentry_sdk.push_scope in SDK
3 participants