Skip to content

Commit

Permalink
test: Unit test top-level last_event_id
Browse files Browse the repository at this point in the history
ref #3049
  • Loading branch information
szokeasaurusrex committed May 8, 2024
1 parent 91afec7 commit 751f6ca
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/test_basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
add_breadcrumb,
Hub,
Scope,
last_event_id,
)
from sentry_sdk.integrations import (
_AUTO_ENABLING_INTEGRATIONS,
Expand Down Expand Up @@ -778,3 +779,24 @@ def test_classmethod_tracing(sentry_init):
with patch_start_tracing_child() as fake_start_child:
assert instance_or_class.class_(1) == (TracingTestClass, 1)
assert fake_start_child.call_count == 1


def test_last_event_id(sentry_init):
sentry_init()

assert last_event_id() is None

capture_exception(ValueError("foo"))

assert last_event_id() is not None


def test_last_event_id_transaction(sentry_init):
sentry_init()

assert last_event_id() is None

with start_transaction():
pass

assert last_event_id() is None

0 comments on commit 751f6ca

Please sign in to comment.