File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
tests/integrations/django Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -164,8 +164,12 @@ def test_management_command_raises():
164164
165165
166166@pytest .mark .django_db
167- def test_sql_queries (sentry_init , capture_events ):
168- sentry_init (integrations = [DjangoIntegration ()], send_default_pii = True )
167+ @pytest .mark .parametrize ("with_integration" , [True , False ])
168+ def test_sql_queries (sentry_init , capture_events , with_integration ):
169+ sentry_init (
170+ integrations = [DjangoIntegration ()] if with_integration else [],
171+ send_default_pii = True ,
172+ )
169173 from django .db import connection
170174
171175 sql = connection .cursor ()
@@ -179,9 +183,12 @@ def test_sql_queries(sentry_init, capture_events):
179183
180184 event , = events
181185
182- crumb = event ["breadcrumbs" ][- 1 ]
186+ if with_integration :
187+ crumb = event ["breadcrumbs" ][- 1 ]
183188
184- assert crumb ["message" ] == """SELECT count(*) FROM people_person WHERE foo = 123"""
189+ assert (
190+ crumb ["message" ] == """SELECT count(*) FROM people_person WHERE foo = 123"""
191+ )
185192
186193
187194@pytest .mark .django_db
You can’t perform that action at this time.
0 commit comments