You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test: TCPHTTPDispatchTests purges pcapkit before every test, and test-coverage.rst records no per-test exception #2562
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.pyTCPHTTPDispatchTests.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.pyConstEnumRegisterFallbackTests.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
JarryShaw commentedon Nov 1, 2026
#2544 has merged, so this is unblocked. A worker is on it; the change is test-only.