Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
antonpirker committed Aug 28, 2023
1 parent ccfc5a1 commit 9ad3478
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/integrations/asgi/test_asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,11 @@ async def app(scope, receive, send):

@pytest.fixture
def asgi3_app_with_error():
async def send_with_error(event):
1 / 0

async def app(scope, receive, send):
await send(
await send_with_error(
{
"type": "http.response.start",
"status": 200,
Expand All @@ -58,10 +61,7 @@ async def app(scope, receive, send):
],
}
)

1 / 0

await send(
await send_with_error(
{
"type": "http.response.body",
"body": b"Hello, world!",
Expand Down Expand Up @@ -167,9 +167,9 @@ async def test_capture_transaction_with_error(
sentry_init(send_default_pii=True, traces_sample_rate=1.0)
app = SentryAsgiMiddleware(asgi3_app_with_error)

events = capture_events()
with pytest.raises(ZeroDivisionError):
async with TestClient(app) as client:
events = capture_events()
await client.get("/")

(error_event, transaction_event) = events
Expand Down Expand Up @@ -423,7 +423,7 @@ async def test_transaction_style(
events = capture_events()
await client.get(url)

(_, transaction_event) = events
(transaction_event,) = events

assert transaction_event["transaction"] == expected_transaction
assert transaction_event["transaction_info"] == {"source": expected_source}
Expand Down

0 comments on commit 9ad3478

Please sign in to comment.