Skip to content

Commit 7cfe29a

Browse files
authored
Fix asyncio tests (#3811)
1 parent ad96b24 commit 7cfe29a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/integrations/asyncio/test_asyncio.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ async def test_create_task(
7474

7575
events = capture_events()
7676

77-
with sentry_sdk.start_transaction(name="test_transaction_for_create_task"):
77+
with sentry_sdk.start_span(name="test_transaction_for_create_task"):
7878
with sentry_sdk.start_span(op="root", name="not so important"):
7979
tasks = [event_loop.create_task(foo()), event_loop.create_task(bar())]
8080
await asyncio.wait(tasks, return_when=asyncio.FIRST_EXCEPTION)
@@ -117,7 +117,7 @@ async def test_gather(
117117

118118
events = capture_events()
119119

120-
with sentry_sdk.start_transaction(name="test_transaction_for_gather"):
120+
with sentry_sdk.start_span(name="test_transaction_for_gather"):
121121
with sentry_sdk.start_span(op="root", name="not so important"):
122122
await asyncio.gather(foo(), bar(), return_exceptions=True)
123123

@@ -160,7 +160,8 @@ async def test_exception(
160160

161161
events = capture_events()
162162

163-
with sentry_sdk.start_transaction(name="test_exception"):
163+
with sentry_sdk.start_span(name="test_exception"):
164+
sentry_sdk.get_isolation_scope().set_transaction_name("test_exception")
164165
with sentry_sdk.start_span(op="root", name="not so important"):
165166
tasks = [event_loop.create_task(boom()), event_loop.create_task(bar())]
166167
await asyncio.wait(tasks, return_when=asyncio.FIRST_EXCEPTION)
@@ -375,7 +376,7 @@ async def test_span_origin(
375376

376377
events = capture_events()
377378

378-
with sentry_sdk.start_transaction(name="something"):
379+
with sentry_sdk.start_span(name="something"):
379380
tasks = [
380381
event_loop.create_task(foo()),
381382
]

0 commit comments

Comments
 (0)