test(django): Prune redundant parametrize rows from the ASGI tests - #7158
Draft
ericapisani wants to merge 3 commits into
Draft
test(django): Prune redundant parametrize rows from the ASGI tests#7158ericapisani wants to merge 3 commits into
ericapisani wants to merge 3 commits into
Conversation
Contributor
Codecov Results 📊✅ 111552 passed | ⏭️ 6669 skipped | Total: 118221 | Pass Rate: 94.36% | Execution Time: 399m 1s 📊 Comparison with Base Branch
➖ Removed Tests (1)View removed tests
All tests are passing successfully. ✅ Patch coverage is 100.00%. Project has 2486 uncovered lines. Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 90.20% 90.20% —%
==========================================
Files 193 193 —
Lines 25370 25370 —
Branches 9310 9310 —
==========================================
+ Hits 22885 22884 -1
- Misses 2485 2486 +1
- Partials 1431 1433 +2Generated by Codecov Action |
The send_default_pii dimension held every row to the same outcome: none of the expected_data values differ between the pii=True and pii=False halves of the table, so the 5 pii=False rows re-ran the assertions of their pii=True counterparts. Drop them and the now-constant dimension. Also drop the application/xml row, which exercises the same "no structured body" branch as the text/plain row already in the table.
…ad_id The arm only toggled creation of middleware spans, which this test never inspects: the streaming path skips non-segment spans, and the static path looks at profile and transaction items. Both DjangoIntegration(middleware_spans=) settings remain covered by the dedicated middleware-span tests.
test_user_identity_error_event_data_collection borrowed the shared 6-row DATA_COLLECTION_USER_INFO_CASES table, 2 rows of which cover send_default_pii vs. data_collection precedence — already asserted by the WSGI tests in test_data_scrubbing.py. Replace it with a local 4-row table covering the branches asgi.py actually takes: pii on/off crossed with data_collection user_info on/off.
ericapisani
force-pushed
the
ep/django-tests-asgi-params
branch
from
August 13, 2026 16:38
7b83466 to
05ce4f0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Three independent redundancies in
asgi/test_asgi.py:test_asgi_request_body— thesend_default_piidimension held every row to the same outcome, so the 5pii=Falserows re-ran theirpii=Truecounterparts. Theapplication/xmlrow takes the same "no structured body" branch as thetext/plainrow.test_active_thread_id— themiddleware_spansarm only toggled spans this test never inspects; both settings stay covered by the dedicated middleware-span tests.test_user_identity_error_event_data_collection— swapped the shared 6-row table for a local 4-row one, dropping the 2 precedence rows already asserted by the WSGI tests intest_data_scrubbing.py.356 -> 320 cases.
Refs PY-2641
Refs #6975