Skip to content

Commit 4fde4f9

Browse files
committed
ref(asyncio): Use data_collection in tests
1 parent 3ef8c1f commit 4fde4f9

1 file changed

Lines changed: 37 additions & 26 deletions

File tree

‎tests/integrations/asyncio/test_asyncio.py‎

Lines changed: 37 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,8 @@ async def test_create_task(
6969
):
7070
sentry_init(
7171
traces_sample_rate=1.0,
72-
send_default_pii=True,
73-
integrations=[
74-
AsyncioIntegration(),
75-
],
72+
data_collection={},
73+
integrations=[AsyncioIntegration()],
7674
)
7775

7876
items = capture_items("span")
@@ -120,10 +118,8 @@ async def test_gather(
120118
):
121119
sentry_init(
122120
traces_sample_rate=1.0,
123-
send_default_pii=True,
124-
integrations=[
125-
AsyncioIntegration(),
126-
],
121+
data_collection={},
122+
integrations=[AsyncioIntegration()],
127123
)
128124

129125
items = capture_items("span")
@@ -160,10 +156,8 @@ async def test_exception(
160156
):
161157
sentry_init(
162158
traces_sample_rate=1.0,
163-
send_default_pii=True,
164-
integrations=[
165-
AsyncioIntegration(),
166-
],
159+
data_collection={},
160+
integrations=[AsyncioIntegration()],
167161
)
168162

169163
events = capture_events()
@@ -189,9 +183,8 @@ async def test_exception(
189183
@pytest.mark.asyncio(loop_scope="module")
190184
async def test_task_result(sentry_init):
191185
sentry_init(
192-
integrations=[
193-
AsyncioIntegration(),
194-
],
186+
integrations=[AsyncioIntegration()],
187+
data_collection={},
195188
)
196189

197190
async def add(a, b):
@@ -208,9 +201,8 @@ async def test_task_with_context(sentry_init):
208201
Integration test to ensure working context parameter in Python 3.11+
209202
"""
210203
sentry_init(
211-
integrations=[
212-
AsyncioIntegration(),
213-
],
204+
integrations=[AsyncioIntegration()],
205+
data_collection={},
214206
)
215207

216208
var = ContextVar("var")
@@ -382,6 +374,7 @@ async def test_span_origin(
382374
sentry_init(
383375
integrations=[AsyncioIntegration()],
384376
traces_sample_rate=1.0,
377+
data_collection={},
385378
)
386379

387380
items = capture_items("span")
@@ -414,9 +407,8 @@ async def test_task_spans_false(
414407

415408
sentry_init(
416409
traces_sample_rate=1.0,
417-
integrations=[
418-
AsyncioIntegration(task_spans=False),
419-
],
410+
integrations=[AsyncioIntegration(task_spans=False)],
411+
data_collection={},
420412
)
421413

422414
items = capture_items("span")
@@ -447,7 +439,10 @@ async def test_enable_asyncio_integration_with_task_spans_false(
447439
"""
448440
uninstall_integration("asyncio")
449441

450-
sentry_init(traces_sample_rate=1.0)
442+
sentry_init(
443+
traces_sample_rate=1.0,
444+
data_collection={},
445+
)
451446

452447
assert "asyncio" not in sentry_sdk.get_client().integrations
453448

@@ -478,6 +473,7 @@ async def test_delayed_enable_integration(
478473
):
479474
sentry_init(
480475
traces_sample_rate=1.0,
476+
data_collection={},
481477
)
482478

483479
assert "asyncio" not in sentry_sdk.get_client().integrations
@@ -516,7 +512,10 @@ async def test_delayed_enable_integration(
516512
@minimum_python_38
517513
@pytest.mark.asyncio
518514
async def test_delayed_enable_integration_with_options(sentry_init, capture_events):
519-
sentry_init(traces_sample_rate=1.0)
515+
sentry_init(
516+
traces_sample_rate=1.0,
517+
data_collection={},
518+
)
520519

521520
assert "asyncio" not in sentry_sdk.get_client().integrations
522521

@@ -543,7 +542,11 @@ async def test_delayed_enable_enabled_integration(sentry_init, uninstall_integra
543542
uninstall_integration("asyncio")
544543

545544
integration = AsyncioIntegration()
546-
sentry_init(integrations=[integration], traces_sample_rate=1.0)
545+
sentry_init(
546+
integrations=[integration],
547+
traces_sample_rate=1.0,
548+
data_collection={},
549+
)
547550

548551
assert "asyncio" in sentry_sdk.get_client().integrations
549552

@@ -570,6 +573,7 @@ async def test_delayed_enable_integration_after_disabling(
570573
sentry_init(
571574
disabled_integrations=[AsyncioIntegration()],
572575
traces_sample_rate=1.0,
576+
data_collection={},
573577
)
574578

575579
assert "asyncio" not in sentry_sdk.get_client().integrations
@@ -616,6 +620,7 @@ async def test_internal_tasks_not_wrapped(
616620
sentry_init(
617621
integrations=[AsyncioIntegration()],
618622
traces_sample_rate=1.0,
623+
data_collection={},
619624
)
620625

621626
async def user_task():
@@ -655,7 +660,10 @@ async def internal_task():
655660

656661
@minimum_python_38
657662
def test_loop_close_patching(sentry_init):
658-
sentry_init(integrations=[AsyncioIntegration()])
663+
sentry_init(
664+
integrations=[AsyncioIntegration()],
665+
data_collection={},
666+
)
659667

660668
loop = asyncio.new_event_loop()
661669
asyncio.set_event_loop(loop)
@@ -679,7 +687,10 @@ def test_loop_close_flushes_async_transport(sentry_init):
679687
if not ASYNC_TRANSPORT_AVAILABLE:
680688
pytest.skip("httpcore[asyncio] not installed")
681689

682-
sentry_init(integrations=[AsyncioIntegration()])
690+
sentry_init(
691+
integrations=[AsyncioIntegration()],
692+
data_collection={},
693+
)
683694

684695
# Save the current event loop to restore it later
685696
try:

0 commit comments

Comments
 (0)