Skip to content

docs(tests): tighten the protocols test prose from the post-sweep merges (#719) - #1073

Merged
JarryShaw merged 1 commit into
mainfrom
docs/719-final-tests-protocols
Oct 6, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
docs/719-final-tests-protocols

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner

What is the purpose of your pull request?

  • docs — documentation only

Description

Final #719 pass over tests/protocols/** prose touched by ef0964c81..efc9c3774. Most of those 50 files only swapped purge_modules for reimport_once_per_class, with no prose. Changes:

  • test_schema_metaclass_abc_cache_unit.py: the setUp comment credited purge_modules, which setUp no longer calls. It now names reimport_once_per_class for the cache reset, and says classes stay fresh per test only because tearDown purges before the class import is kept. Verified: the schema module id differs in every test.
  • test_dispatch_reachability_unit.py: drop the "no longer one import per test" history.
  • test_option_roundtrip_unit.py, test_dispatch_registry_unit.py: the comment cited a setUp purge, but neither class has a setUp; the purge is in setUpClass.
  • test_ipv6_ext_unit.py, test_pcapng_unit.py: tightened wording.

Tests: 6 modules pass; tests/project 375 passed, 1 skipped.

File AST equal (docstrings stripped)
tests/protocols/internet/test_ipv6_ext_unit.py True
tests/protocols/misc/test_pcapng_unit.py True
tests/protocols/schema/test_schema_metaclass_abc_cache_unit.py True
tests/protocols/test_dispatch_reachability_unit.py True
tests/protocols/test_dispatch_registry_unit.py True
tests/protocols/test_option_roundtrip_unit.py True

…ges (#719)

- abc-cache setUp: name what now resets the cache and why the classes are
  still fresh per test (tearDown purges before the class import is kept)
- dispatch reachability: drop the "no longer one import per test" history
- option round trip / dispatch registry: the purge is in setUpClass; neither
  class has a setUp
- ipv6_ext, pcapng: tighten the #917 cross-reference and the sweep-cache note

Comments and docstrings only; AST-identical to origin/main.
@JarryShaw JarryShaw added docs Pull requests that change documentation only (docs: subject prefix) review: running A cross-review is in flight against the current head - no verdict yet labels Oct 6, 2026
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Coverage: 88.74% (unit tier, Python 3.14, f010f266a, Unit Tests run success)

Package Statements Missed Branches Partial Cover
pcapkit (top level) 104 4 20 4 93.55%
pcapkit/const 18757 1035 2342 846 90.23%
pcapkit/corekit 1874 91 578 22 94.33%
pcapkit/dumpkit 136 0 40 0 100.00%
pcapkit/foundation 2422 143 842 34 92.62%
pcapkit/interface 112 7 40 5 92.11%
pcapkit/protocols 15653 187 3942 162 98.19%
pcapkit/toolkit 487 71 144 3 84.15%
pcapkit/utilities 429 4 122 4 98.55%
pcapkit/vendor 4409 2359 1006 158 42.84%

Per-file detail: the coverage-html artifact of this run.

@JarryShaw

Copy link
Copy Markdown
Owner Author

Cross-review verdict on f010f266a: GOOD TO GO (ran on Sonnet; author Opus)

  • No code changed. All 6 files are AST-identical to origin/main once bare strings are stripped.
  • abc-cache setUp comment holds under pytest with conftest active:
    • On the first test, tearDown purges before _keep_lazy_imports runs, so the class holds {}.
    • Later tests restore that empty import, which resets the abc cache.
    • The reviewer's probe saw a distinct Schema object in each of the 5 tests that import it.
  • No setUp in the two other classes. Neither has one, here or on main; the purge is in setUpClass, ahead of the generator load.
  • Rationale kept. The gc reasoning is unchanged. _sweep() has 4 callers, so "the other three" is right.
  • Tests pass. The touched modules and tests/project (375 passed, 1 skipped).
  • UNVERIFIED by the reviewer: a full test_pcapng_unit.py run. Only the touched class ran (10 passed). The author's run of the full module gave 97 passed.

@JarryShaw JarryShaw added review: good-to-go Cross-review at the current head says ready; CI state is separate and removed review: running A cross-review is in flight against the current head - no verdict yet labels Oct 6, 2026
@JarryShaw
JarryShaw merged commit df074cb into main Oct 6, 2026
41 checks passed
@JarryShaw
JarryShaw deleted the docs/719-final-tests-protocols branch October 6, 2026 14:04
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Pull requests that change documentation only (docs: subject prefix)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant