@@ -402,9 +402,6 @@ async def test_task_spans_false(
402402 capture_events ,
403403 uninstall_integration ,
404404):
405- """
406- Test that task_spans=False disables span creation but retains scope isolation.
407- """
408405 uninstall_integration ("asyncio" )
409406
410407 sentry_init (
@@ -417,18 +414,14 @@ async def test_task_spans_false(
417414 events = capture_events ()
418415
419416 with sentry_sdk .start_transaction (name = "test_no_spans" ):
420- with sentry_sdk .start_span (op = "root" , name = "root span" ):
421- tasks = [asyncio .create_task (foo ()), asyncio .create_task (bar ())]
422- await asyncio .wait (tasks , return_when = asyncio .FIRST_EXCEPTION )
417+ tasks = [asyncio .create_task (foo ()), asyncio .create_task (bar ())]
418+ await asyncio .wait (tasks , return_when = asyncio .FIRST_EXCEPTION )
423419
424420 sentry_sdk .flush ()
425421
426422 (transaction_event ,) = events
427423
428- # Only the root span should be present, no asyncio spans
429- assert len (transaction_event ["spans" ]) == 1
430- assert transaction_event ["spans" ][0 ]["op" ] == "root"
431- assert transaction_event ["spans" ][0 ]["description" ] == "root span"
424+ assert not transaction_event ["spans" ]
432425
433426
434427@minimum_python_38
@@ -460,7 +453,6 @@ async def test_enable_asyncio_integration_with_task_spans_false(
460453 sentry_sdk .flush ()
461454
462455 (transaction ,) = events
463- # No asyncio spans should be created
464456 assert not transaction ["spans" ]
465457
466458
0 commit comments