Skip to content

Commit dfe4dde

Browse files
committed
Updated test
1 parent 631ad1b commit dfe4dde

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

tests/integrations/fastapi/test_fastapi.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,10 @@ async def subapp_route():
677677

678678
@pytest.mark.asyncio
679679
async def test_feature_flags(sentry_init, capture_events):
680-
sentry_init(integrations=[StarletteIntegration(), FastApiIntegration()])
680+
sentry_init(
681+
traces_sample_rate=1.0,
682+
integrations=[StarletteIntegration(), FastApiIntegration()],
683+
)
681684

682685
events = capture_events()
683686

@@ -697,8 +700,14 @@ async def _error():
697700
except ValueError:
698701
pass
699702

700-
assert events[0]["contexts"]["flags"] == {
701-
"values": [
702-
{"flag": "hello", "result": False},
703-
]
704-
}
703+
found = False
704+
for event in events:
705+
if "exception" in event.keys():
706+
assert event["contexts"]["flags"] == {
707+
"values": [
708+
{"flag": "hello", "result": False},
709+
]
710+
}
711+
found = True
712+
713+
assert found, "No event with exception found"

0 commit comments

Comments
 (0)