File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed
tests/integrations/fastapi Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -677,7 +677,10 @@ async def subapp_route():
677677
678678@pytest .mark .asyncio
679679async 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"
You can’t perform that action at this time.
0 commit comments