Skip to content

Commit 751f6ca

Browse files
test: Unit test top-level last_event_id
ref #3049
1 parent 91afec7 commit 751f6ca

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/test_basics.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
add_breadcrumb,
1919
Hub,
2020
Scope,
21+
last_event_id,
2122
)
2223
from sentry_sdk.integrations import (
2324
_AUTO_ENABLING_INTEGRATIONS,
@@ -778,3 +779,24 @@ def test_classmethod_tracing(sentry_init):
778779
with patch_start_tracing_child() as fake_start_child:
779780
assert instance_or_class.class_(1) == (TracingTestClass, 1)
780781
assert fake_start_child.call_count == 1
782+
783+
784+
def test_last_event_id(sentry_init):
785+
sentry_init()
786+
787+
assert last_event_id() is None
788+
789+
capture_exception(ValueError("foo"))
790+
791+
assert last_event_id() is not None
792+
793+
794+
def test_last_event_id_transaction(sentry_init):
795+
sentry_init()
796+
797+
assert last_event_id() is None
798+
799+
with start_transaction():
800+
pass
801+
802+
assert last_event_id() is None

0 commit comments

Comments
 (0)