From 551ac5576c3fcc226a7f5c916d158e681fc4655c Mon Sep 17 00:00:00 2001 From: Erica Pisani Date: Thu, 6 Aug 2026 14:29:55 -0400 Subject: [PATCH 1/4] test(django): Remove stale xfail marker from test_read_request The marker was added in 2019 (6326cb68b) with no reason or issue reference, and the test now XPASSes across the supported Django range (verified 5.2.16 and 6.x; the already-read-body handling it exercises is stable Django public-contract behavior). A non-strict xfail that always passes can never fail the build, so the test was dead weight that would have silently xpassed a real regression. Removing the marker restores it as a genuine regression guard. --- tests/integrations/django/test_basic.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/integrations/django/test_basic.py b/tests/integrations/django/test_basic.py index 93b5477010..1c34b1680f 100644 --- a/tests/integrations/django/test_basic.py +++ b/tests/integrations/django/test_basic.py @@ -1369,7 +1369,6 @@ def test_request_body( assert "" not in event -@pytest.mark.xfail @pytest.mark.parametrize("span_streaming", [True, False]) def test_read_request( sentry_init, From c48f5baa5af1682d76ea0854b9c30d7683625bb7 Mon Sep 17 00:00:00 2001 From: Erica Pisani Date: Thu, 6 Aug 2026 14:34:50 -0400 Subject: [PATCH 2/4] test(django): Remove dead rest_hello view and URL from test app No test references rest_hello (its test was removed in a 2019-era revert cycle); every other registered URL is exercised by the suite. --- tests/integrations/django/myapp/urls.py | 1 - tests/integrations/django/myapp/views.py | 4 ---- 2 files changed, 5 deletions(-) diff --git a/tests/integrations/django/myapp/urls.py b/tests/integrations/django/myapp/urls.py index 87d11b791b..e1d0c4c90c 100644 --- a/tests/integrations/django/myapp/urls.py +++ b/tests/integrations/django/myapp/urls.py @@ -149,7 +149,6 @@ def path(path, *args, **kwargs): name="rest_framework_read_body_and_exc", ) ) - urlpatterns.append(path("rest-hello", views.rest_hello, name="rest_hello")) urlpatterns.append( path( "rest-authenticated-hello", diff --git a/tests/integrations/django/myapp/views.py b/tests/integrations/django/myapp/views.py index 21f27455a5..f926ddd1a6 100644 --- a/tests/integrations/django/myapp/views.py +++ b/tests/integrations/django/myapp/views.py @@ -49,10 +49,6 @@ def rest_framework_read_body_and_exc(request): request.data 1 / 0 - @api_view(["GET"]) - def rest_hello(request): - return HttpResponse("ok") - @api_view(["GET"]) def rest_permission_denied_exc(request): raise PermissionDenied("bye") From e5a5204b04d5b817e49734d17414802c4b1f32b9 Mon Sep 17 00:00:00 2001 From: Erica Pisani Date: Fri, 7 Aug 2026 09:57:39 -0400 Subject: [PATCH 3/4] test(django): Remove spurious django_db marker from test_response_trace Empirical audit of all 61 django_db-marked tests in the django suite: 60 are load-bearing (DB queries, login, or session-cookie loads via SessionMiddleware). The cache tests' markers also stay: stripping them broke a pytest-forked x pytest-django teardown invariant. This test is the only one that is genuinely DB-free (DRF view with no ORM work, no session cookie sent) and safe to unmark. --- tests/integrations/django/test_basic.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/integrations/django/test_basic.py b/tests/integrations/django/test_basic.py index 1c34b1680f..bb5014932c 100644 --- a/tests/integrations/django/test_basic.py +++ b/tests/integrations/django/test_basic.py @@ -815,7 +815,6 @@ def test_sql_dict_query_params( @pytest.mark.forked -@pytest_mark_django_db_decorator() @pytest.mark.parametrize("span_streaming", [True, False]) def test_response_trace( sentry_init, From 7b3b9110f54be59981af6ec5921754147ed6884a Mon Sep 17 00:00:00 2001 From: Erica Pisani Date: Fri, 7 Aug 2026 10:03:25 -0400 Subject: [PATCH 4/4] test(django): Remove unused fixture args from 7 test signatures AST-verified unused: capture_events in test_materialized_user_captured (never called), client in 6 raw-cursor executemany tests (no HTTP). Unrequested fixtures are never built, so removal is behavior-neutral; signatures now truthfully describe each test's dependencies. --- tests/integrations/django/test_basic.py | 1 - tests/integrations/django/test_db_query_data.py | 1 - tests/integrations/django/test_db_transactions.py | 5 ----- 3 files changed, 7 deletions(-) diff --git a/tests/integrations/django/test_basic.py b/tests/integrations/django/test_basic.py index bb5014932c..491e185610 100644 --- a/tests/integrations/django/test_basic.py +++ b/tests/integrations/django/test_basic.py @@ -535,7 +535,6 @@ def test_user_captured( def test_materialized_user_captured( sentry_init, client, - capture_events, capture_items, ): sentry_init( diff --git a/tests/integrations/django/test_db_query_data.py b/tests/integrations/django/test_db_query_data.py index 92162cf1c3..0739b0992b 100644 --- a/tests/integrations/django/test_db_query_data.py +++ b/tests/integrations/django/test_db_query_data.py @@ -900,7 +900,6 @@ def test_db_span_origin_execute( @pytest.mark.parametrize("span_streaming", [True, False]) def test_db_span_origin_executemany( sentry_init, - client, capture_events, capture_items, span_streaming, diff --git a/tests/integrations/django/test_db_transactions.py b/tests/integrations/django/test_db_transactions.py index 179b9920c6..3b5dadfea7 100644 --- a/tests/integrations/django/test_db_transactions.py +++ b/tests/integrations/django/test_db_transactions.py @@ -617,7 +617,6 @@ def test_db_no_autocommit_execute( @pytest.mark.parametrize("span_streaming", [True, False]) def test_db_no_autocommit_executemany( sentry_init, - client, capture_events, capture_items, span_streaming, @@ -900,7 +899,6 @@ def test_db_no_autocommit_rollback_execute( @pytest.mark.parametrize("span_streaming", [True, False]) def test_db_no_autocommit_rollback_executemany( sentry_init, - client, capture_events, capture_items, span_streaming, @@ -1181,7 +1179,6 @@ def test_db_atomic_execute( @pytest.mark.parametrize("span_streaming", [True, False]) def test_db_atomic_executemany( sentry_init, - client, capture_events, capture_items, span_streaming, @@ -1457,7 +1454,6 @@ def test_db_atomic_rollback_execute( @pytest.mark.parametrize("span_streaming", [True, False]) def test_db_atomic_rollback_executemany( sentry_init, - client, capture_events, capture_items, span_streaming, @@ -1737,7 +1733,6 @@ def test_db_atomic_execute_exception( @pytest.mark.parametrize("span_streaming", [True, False]) def test_db_atomic_executemany_exception( sentry_init, - client, capture_events, capture_items, span_streaming,