Skip to content

test: TCPHTTPDispatchTests purges pcapkit before every test, and test-coverage.rst records no per-test exception #2562

Open

Description

@JarryShaw

From the 2026-11-01 conventions audit, re-verified on 73add05a3. test-coverage.rst, "Running the Tests", bullet "Import once per class": a class that needs a fresh pcapkit calls reimport_once_per_class(self) from setUp, in place of a per-test purge_modules (#1065).

  • tests/protocols/transport/test_tcp_http_dispatch_unit.py TCPHTTPDispatchTests.setUp calls purge_modules(['pcapkit']) before each test and gives no reason; its tests read TCP.__proto__ and parse fixed bytes, so no need for a fresh import is evident.
  • tests/const/test_const_enum_builtin_parity.py ConstEnumRegisterFallbackTests.setUp also purges per test, but with a reason in a comment (an earlier lookup grows the registries' tables), and tests/project/test_per_class_import_guard.py (ci: periodic CI-duration review, and optimisations as the suite grows #1538) names it as the sanctioned per-test form. The page states no such exception.

Fix: switch TCPHTTPDispatchTests to reimport_once_per_class(self); add the per-test form to the bullet, with its reason and the guard's name.
Blocked: #2544 edits test_tcp_http_dispatch_unit.py; unblocks when it merges (gh pr view 2544 --json state -q .state prints MERGED).

Activity

  1. added
    testPull requests that add or correct tests (test: subject prefix)
    blockedDeferred pending another issue or decision; see the last comment for what unblocks it
    on Nov 1, 2026
  2. moved this to Blocked in PyPCAPKiton Nov 1, 2026
  3. JarryShaw commented on Nov 1, 2026

    @JarryShaw
    OwnerAuthor

    #2544 has merged, so this is unblocked. A worker is on it; the change is test-only.

  4. added
    wipWork in flight - a covering PR is open or an agent is actively on it
    and removed
    blockedDeferred pending another issue or decision; see the last comment for what unblocks it
    on Nov 1, 2026
  5. moved this from Blocked to WIP in PyPCAPKiton Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    testPull requests that add or correct tests (test: subject prefix)wipWork in flight - a covering PR is open or an agent is actively on it

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions