Skip to content

Commit 160e430

Browse files
committed
checking for warning
1 parent e783af9 commit 160e430

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

tests/integrations/django/asgi/test_asgi.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,22 @@
3131
@pytest.mark.asyncio
3232
@pytest.mark.forked
3333
async def test_basic(sentry_init, capture_events, application):
34-
if sys.version_info <= (3, 8):
35-
with pytest.warns(DeprecationWarning):
36-
sentry_init(
37-
integrations=[DjangoIntegration()],
38-
send_default_pii=True,
39-
)
40-
else:
41-
sentry_init(
42-
integrations=[DjangoIntegration()],
43-
send_default_pii=True,
44-
)
34+
sentry_init(
35+
integrations=[DjangoIntegration()],
36+
send_default_pii=True,
37+
)
4538

4639
events = capture_events()
4740

48-
comm = HttpCommunicator(application, "GET", "/view-exc?test=query")
49-
response = await comm.get_response()
50-
await comm.wait()
41+
if sys.version_info <= (3, 8):
42+
with pytest.warns(DeprecationWarning):
43+
comm = HttpCommunicator(application, "GET", "/view-exc?test=query")
44+
response = await comm.get_response()
45+
await comm.wait()
46+
else:
47+
comm = HttpCommunicator(application, "GET", "/view-exc?test=query")
48+
response = await comm.get_response()
49+
await comm.wait()
5150

5251
assert response["status"] == 500
5352

0 commit comments

Comments
 (0)