From 4db99552387fff64fbd5f513b4003ecc11027c62 Mon Sep 17 00:00:00 2001 From: Jarry Shaw Date: Thu, 15 Oct 2026 11:36:28 -0400 Subject: [PATCH] docs(tests): correct stale claims in test docstrings and comments (#1103) Prose only: the AST of every changed module, string expression statements blanked, is identical to origin/main's. - Timed context: "this PR" names its PR (#755, #802, #836, #854, #869, #874, #922, #926); "today", "as of writing", "right now", "until now" and a "now installs" are anchored or dropped. - Stale state: closed issues no longer read as open or in flight (#576, #651/#664, #674, #527, #531), and the minting, KNOWN_DEFECTS, vendor-depth and MPTCP-parse narratives are put in the past tense where later changes retired them. - Moved or renamed names: beholder's home, HTTP._read_http_header, PCAPNGSectionRuleTests, test_new_engine_parity_runtime, and the scapy cast that #1652 removed. - Line references: about 50 file:line pointers into pcapkit/, pyproject.toml, Pipfile and sibling tests re-measured. - Counts re-derived: raise targets and nested defs in test_docstring_contract, and the four returned nested defs it names. - A pytest-subtests claim corrected to pytest's own reporting. Refs #1103 --- tests/conftest.py | 2 +- tests/const/test_const_apptype_split_unit.py | 22 +++++++-------- tests/const/test_const_enum_builtin_parity.py | 20 +++++++------- tests/const/test_const_enum_no_mint.py | 16 +++++------ ...st_const_ipv6_extension_header_925_unit.py | 2 +- tests/const/test_const_linktype_209_unit.py | 4 +-- .../const/test_const_str_payload_870_unit.py | 2 +- .../corekit/test_fields_copy_dispatch_unit.py | 16 +++++------ .../test_fields_misc_packet_context.py | 2 +- ...fields_numbers_port_option_no_mint_unit.py | 4 +-- tests/corekit/test_module.py | 2 +- tests/corekit/test_sentinels_housing_unit.py | 2 +- .../foundation/engines/test_pcapng_engine.py | 2 +- .../foundation/engines/test_pypcap_engine.py | 2 +- .../foundation/engines/test_pyshark_engine.py | 2 +- tests/foundation/registry/test_protocols.py | 2 +- .../test_extraction_record_header_unit.py | 2 +- tests/integration/test_engine_parity.py | 2 +- tests/integration/test_pcapng_end_to_end.py | 4 +-- tests/project/test_annotation_names.py | 12 ++++----- tests/project/test_module_isolation.py | 2 +- tests/project/test_public_api.py | 18 ++++++------- tests/project/test_pyshark_encap_map.py | 8 +++--- tests/project/test_release_gates.py | 4 +-- .../test_release_tags_the_run_sha_1634.py | 2 +- tests/project/test_rfc_anchor_fragments.py | 6 ++--- tests/protocols/application/test_http_unit.py | 8 +++--- .../test_httpv2_payload_length_unit.py | 12 ++++----- .../test_hip_locator_set_length_unit.py | 2 +- tests/protocols/internet/test_hip_unit.py | 4 +-- .../protocols/internet/test_ipv6_ext_unit.py | 2 +- tests/protocols/internet/test_mh_unit.py | 2 +- tests/protocols/misc/test_pcapng_unit.py | 2 +- .../test_schema_metaclass_abc_cache_unit.py | 2 +- .../test_construction_keyword_check_unit.py | 12 ++++----- .../transport/test_tcp_http_dispatch_unit.py | 2 +- .../test_tcp_mptcp_error_message_unit.py | 14 +++++----- .../test_tcp_mptcp_join_flag_ordering_unit.py | 4 +-- .../transport/test_tcp_mptcp_length_unit.py | 27 ++++++++++--------- .../transport/test_tcp_mptcp_subtype_unit.py | 2 +- tests/test_docstring_contract.py | 26 ++++++++++-------- tests/test_support_helpers.py | 2 +- tests/toolkit/test_scapy_unit.py | 2 +- .../vendor/test_crawler_reachability_unit.py | 22 +++++++-------- .../test_re_sub_positional_flag_unit.py | 2 +- tests/vendor/test_vendor_dest_path_unit.py | 15 ++++++----- ...t_vendor_ipv6_extension_header_925_unit.py | 2 +- tests/vendor/test_vendor_missing_body_unit.py | 2 +- .../test_vendor_reg_apptype_generator_unit.py | 2 +- .../test_vendor_snapshot_restore_unit.py | 2 +- 50 files changed, 171 insertions(+), 163 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 3bf13614aa..b3b4afb50d 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -244,7 +244,7 @@ def restore_module_table() -> 'Iterator[None]': :class:`~typing.Generic` stayed bound after the test that installed it, and the next test to import :mod:`pcapkit` died on ``TypeError: type 'ProtocolBase' is not subscriptable`` at - ``pcapkit/protocols/misc/pcap/frame.py:59`` -- twelve tests in + ``pcapkit/protocols/misc/pcap/frame.py:61`` -- twelve tests in :mod:`tests.project`, and only when the polluting file happened to be collected first. Three separate files turned out to leak this way, one of which -- :mod:`tests.cli.test_main` -- did not import :mod:`tests._support` diff --git a/tests/const/test_const_apptype_split_unit.py b/tests/const/test_const_apptype_split_unit.py index 86fbc9d985..fcc7eea9cf 100644 --- a/tests/const/test_const_apptype_split_unit.py +++ b/tests/const/test_const_apptype_split_unit.py @@ -674,7 +674,7 @@ def test_a_bare_int_composite_is_refused_as_a_whole(self) -> None: transport whose bit was set -- the fix for #759, where resolving one by picking the lowest set bit (``tcp``, iterating **LSB-first**) dispatched every composite containing it into the TCP registry whatever else it - named. The owner's ruling on this PR (#836) retires that decoding + named. The owner's ruling on #836 retires that decoding instead of refining it: with ``TransportProtocol`` no longer a flag, ``|``-joined values are no longer parsed and accepted, and the value is treated as a whole rather than split. A bare-int composite is therefore @@ -1440,20 +1440,20 @@ def test_transport_protocol_dropped_its_flag_base(self) -> None: self.assertEqual(len(TransportProtocol.__members__), 5) def test_get_refuses_an_unrecognised_name_rather_than_minting_it(self) -> None: - """Maintainer ruling on this PR (#836), the ``TransportProtocol.get`` inline comment. + """Maintainer ruling on #836, the ``TransportProtocol.get`` inline comment. ``TransportProtocol.get`` used to mint a brand-new member for any - name it did not recognise. This PR's own prior revision minted at + name it did not recognise. #836's own prior revision minted at ``max_val + 1`` -- right after ``dccp``'s 8, so ``.get('bogus')`` minted 9 -- rather than stock ``ad4805f5f``'s ``max_val * 2`` doubling, which mints 16 for that same call; the difference between the two schemes is explained below. The maintainer's ruling, given in - an inline review comment on this PR, refuses minting outright either + an inline review comment on #836, refuses minting outright either way: ``TransportProtocol`` is not to be extended at all. There is no bound left to walk and nothing left to mint, so the refusal is the one plain :class:`ValueError` every unrecognised name gets, whether or not it happens to spell a composite like ``'tcp|udp'``. A later round of - this PR briefly gave the composite case its own, more specific message; + #836 briefly gave the composite case its own, more specific message; the owner's ruling retired that split too -- with ``TransportProtocol`` no longer a flag, ``|``-joined values are no longer parsed and accepted, and the value is treated as a whole rather than split -- so @@ -1476,9 +1476,9 @@ def test_get_refuses_an_unrecognised_name_rather_than_minting_it(self) -> None: :meth:`AppType._dispatch` nothing minted to mis-decode in the first place. - Regression check: this fails against this PR's own prior head, + Regression check: this fails against #836's own prior head, ``3567359e2``, which still mints ``9`` and returns it rather than - raising -- see the session report for the quoted failure. + raising. """ from pcapkit.utilities.exceptions import ProtocolError @@ -1521,12 +1521,12 @@ def test_get_refuses_a_composite_spelled_string(self) -> None: ``test_a_bare_int_composite_is_refused_as_a_whole``). :func:`~pcapkit.foundation.registry.protocols.register_apptype` refuses the identical string the same generic way it refuses any other - unrecognised one, and the owner's ruling on this PR -- with + unrecognised one, and the owner's ruling on #836 -- with ``TransportProtocol`` no longer a flag, ``|``-joined values are no longer parsed and accepted, and the value is treated as a whole rather than split -- settles :meth:`TransportProtocol.get` onto that same answer: ``'|'`` is not special, it is simply not the name of a declared - member. A review round of this PR briefly carved the composite case out + member. A review round of #836 briefly carved the composite case out with its own diagnostic message; the owner's ruling retired that too. """ from pcapkit.const.reg.apptype import TransportProtocol @@ -1546,8 +1546,8 @@ def test_a_bare_int_with_a_stray_bit_names_no_registry_either(self) -> None: ``17`` is ``1 | 16`` -- ``tcp`` plus a bit no registry declares -- so it never named a clean composite of real transports the way ``3`` (``tcp | udp``) once did either, back when ``_dispatch`` still - decoded a bare int's bits at all. The owner's ruling on this PR - (#836) retired that decoding entirely (see + decoded a bare int's bits at all. The owner's ruling on #836 + retired that decoding entirely (see ``test_a_bare_int_composite_is_refused_as_a_whole``), so ``17`` and ``3`` are no longer two different cases -- both are simply an ``int`` that names no registry, and both get the identical plain diff --git a/tests/const/test_const_enum_builtin_parity.py b/tests/const/test_const_enum_builtin_parity.py index 336d08bd97..f34b3269bb 100644 --- a/tests/const/test_const_enum_builtin_parity.py +++ b/tests/const/test_const_enum_builtin_parity.py @@ -29,12 +29,14 @@ templates under :mod:`pcapkit.vendor` rather than hand-written -- the tree is generated, so a fix that is not in the template is reverted by the next crawl. -The one deliberate divergence from the built-in is preserved and pinned here: -the *mutable* registries look a value up, miss, and then **register** it with -:func:`~aenum.extend_enum` instead of raising. That is the exception the owner -named, and :class:`ConstEnumRegisterFallbackTests` exists so a future guard -cannot quietly turn a registration into a rejection -- the failure mode GitHub -issues #584 and #623 are both about. +The one divergence from the built-in the owner named was the *mutable* +registries': look a value up, miss, and then **register** it with +:func:`~aenum.extend_enum` instead of raising. GitHub issues #775 and #860 +retired it, so a miss resolves to an equal, unregistered member instead, and +only :class:`~pcapkit.const.mh.cga_type.CGAType` still extends on a miss. +:class:`ConstEnumRegisterFallbackTests` pins that, and that no guard turns the +lookup into an outright crash -- the failure mode GitHub issues #584 and #623 +are both about. The guard for the three flag registries delegates in-range composites to ``super()._missing_`` rather than resolving them itself, because GitHub issue @@ -854,7 +856,7 @@ def test_transport_protocol_can_no_longer_be_extended_at_runtime(self) -> None: for why composing stopped mattering -- but left the doubling itself alone: stock ``ad4805f5f`` still mints at ``max_val * 2``, so ``.get('quic')`` there returns ``16``, right after ``dccp``'s ``8``. - This PR's own intermediate revision, not #808, is what switched an + #836's own intermediate revision, not #808, is what switched an unrecognised name to ``max_val + 1`` instead, minting ``9``. The review ruling on PR #836 removes the registration from ``TransportProtocol.get`` entirely, regardless of which scheme numbered @@ -868,9 +870,9 @@ def test_transport_protocol_can_no_longer_be_extended_at_runtime(self) -> None: module's ruling changing which registries are mutable, not a regression the sweep above would otherwise have to catch. - Regression check: this fails against this PR's own prior head, + Regression check: this fails against #836's own prior head, ``3567359e2``, which still registers ``'quic'`` at value 9 rather - than raising -- see the session report for the quoted failure. + than raising. """ from pcapkit.const.reg.apptype import TransportProtocol diff --git a/tests/const/test_const_enum_no_mint.py b/tests/const/test_const_enum_no_mint.py index 449095874f..d1b06c2304 100644 --- a/tests/const/test_const_enum_no_mint.py +++ b/tests/const/test_const_enum_no_mint.py @@ -1785,7 +1785,7 @@ def test_optiontype_members_ns_is_not_corrupted(self) -> None: def test_optiontype_get_int_path_no_longer_mints(self) -> None: """:meth:`OptionType.get` used to mint directly on a miss (bypassing - ``_missing_`` entirely) -- a second, independent mint site this PR's + ``_missing_`` entirely) -- a second, independent mint site #869's first pass left alone. Round 2 review measured it live on the wire-facing path (:meth:`pcapkit.protocols.misc.pcapng.PCAPNG. _make_pcapng_options` calls ``get()`` with raw option-code bytes), @@ -1980,7 +1980,7 @@ def test_command_missing_no_longer_mints(self) -> None: measured regression risk: swapping the value for the canonicalised name (as an earlier revision of this conversion did) would make ``Command('xyzw') == 'xyzw'`` false, which never held on ``main`` - and would have been this PR's one real behaviour break.""" + and would have been #869's one real behaviour break.""" from pcapkit.const.ftp.command import Command, CommandType, ConformanceRequirement before = len(Command.__members__) @@ -2347,13 +2347,13 @@ class AppTypeUnmintConvertedTests(unittest.TestCase): genuine IANA-registered name or a manufactured placeholder, because only ``register()`` may create a new entry and ``get()`` never has enough information to build one itself. A lookup resolving - ``TCP(6010)`` after this PR therefore returns an *unregistered* ``x11`` + ``TCP(6010)`` therefore returns an *unregistered* ``x11`` member -- correct as a service name, but absent from ``__members__``/``_value2member_map_`` until someone calls ``TCP.register(6010, 'x11')`` explicitly. Unlike every bespoke class #860 step 2's PR 1 converted, - :meth:`AppType.get` already existed before this PR and does genuine + :meth:`AppType.get` already existed before #874 and does genuine transport-protocol dispatch through :meth:`~AppType._dispatch` -- so, unlike :class:`~pcapkit.const.http.status_code.StatusCode`/ :class:`~pcapkit.const.ftp.return_code.ReturnCode`, it keeps its own @@ -2367,7 +2367,7 @@ class AppTypeUnmintConvertedTests(unittest.TestCase): :meth:`__repr__`/:meth:`__str__`/:meth:`__int__`/the comparison operators/:attr:`~AppType.aliases` to run on the result without raising. - :meth:`AppType.register` is new on this PR. ``AppType`` already had a + :meth:`AppType.register` arrived with #874. ``AppType`` already had a working ``get``/``get_all``/``register_alias`` of its own, but never a working ``register`` -- and the base's generic one (which calls ``cls.__new__(cls, value)`` with only ``value``) would have built a @@ -2388,7 +2388,7 @@ def test_apptype_family_carries_the_registry_protocol(self) -> None: """#842's ruling is that ``get``/``get_all``/``register``/ ``register_alias`` exist on every registry -- #860 step 2 PR 2 is what actually delivers that for this family, including ``register``, - which none of the five had a working version of before this PR.""" + which none of the five had a working version of before #874.""" from pcapkit.const.reg.apptype.apptype import AppType from pcapkit.const.reg.apptype.dccp import DCCP from pcapkit.const.reg.apptype.sctp import SCTP @@ -2503,7 +2503,7 @@ def test_get_second_mint_site_no_longer_mints(self) -> None: self.assertFalse(TCP.__registry__.getlist(54321)) def test_missing_direct_call_still_raises_for_the_same_port(self) -> None: - """The asymmetry this PR leaves in place, deliberately: a direct + """The asymmetry #874 leaves in place, deliberately: a direct ``TCP(54321)`` has no ``get()`` around it to catch ``_missing_``'s :obj:`None` answer and build an ``'unknown'`` member from it, so it still raises exactly as it did on ``main`` -- only :meth:`AppType. @@ -2649,7 +2649,7 @@ def test_values_are_sequential_from_zero(self) -> None: self.assertEqual(int(TransportProtocol.dccp), 4) def test_still_not_a_registry(self) -> None: - """Unaffected by this PR: ``TransportProtocol`` never minted through + """Unaffected by #874: ``TransportProtocol`` never minted through :meth:`~pcapkit.corekit.enum.EnumRegistry._unregistered_member`, and does not mix in :class:`~pcapkit.corekit.enum.EnumRegistry` now either -- only ``AppType`` and its four transport subclasses do.""" diff --git a/tests/const/test_const_ipv6_extension_header_925_unit.py b/tests/const/test_const_ipv6_extension_header_925_unit.py index 6ab0271956..211c364191 100644 --- a/tests/const/test_const_ipv6_extension_header_925_unit.py +++ b/tests/const/test_const_ipv6_extension_header_925_unit.py @@ -68,7 +68,7 @@ def test_extension_header_now_has_exactly_eleven_members(self) -> None: self.assertNotIn('BIT_EMU', names) def test_bit_emu_value_no_longer_resolves(self) -> None: - # The exact call pcapkit/protocols/internet/ipv6.py:378 makes at the + # The exact call IPv6._decode_next_layer makes at the # top of its extension-header walk loop. With BIT_EMU gone and no # _missing_ defined on this generated file (neither EnumLookup nor # EnumRegistry in pcapkit.corekit.enum defines one either), 147 now diff --git a/tests/const/test_const_linktype_209_unit.py b/tests/const/test_const_linktype_209_unit.py index 3b2c70714e..4492ddf1c3 100644 --- a/tests/const/test_const_linktype_209_unit.py +++ b/tests/const/test_const_linktype_209_unit.py @@ -83,7 +83,7 @@ #: ``html5lib`` is the one that is actually missing on ``test``: ``requests`` and #: ``bs4`` have shipped in the ``test`` extra since #507, but only #: ``beautifulsoup4[html5lib]`` -- the ``vendor`` and ``all`` extras -- provides a -#: parser (``pyproject.toml:203``, and the note at ``:256-263`` saying so +#: parser (``pyproject.toml:234``, and the note at ``:313-320`` saying so #: deliberately). VENDOR_DEPS = ('requests', 'bs4', 'html5lib') @@ -511,7 +511,7 @@ def test_malformed_en_dash_range_still_raises_loudly(self) -> None: temp.split('–'))``, which hits the identical unpack error a few lines later and still raises, uncaught, out of :meth:`process`. That statement predates #852 entirely, so this assertion passes - identically on ``main``, on this PR's first commit (before + identically on ``main``, on #854's first commit (before ``_expand`` existed), and here: nothing about the pre-scan is what is being pinned. """ diff --git a/tests/const/test_const_str_payload_870_unit.py b/tests/const/test_const_str_payload_870_unit.py index cae756933b..142041ff3d 100644 --- a/tests/const/test_const_str_payload_870_unit.py +++ b/tests/const/test_const_str_payload_870_unit.py @@ -30,7 +30,7 @@ own wire string now succeeds where it used to fail silently (no exception -- just an unexpected :data:`False`). Nothing under :mod:`pcapkit.protocols` compared a member this way before the fix (the one caller, -:meth:`pcapkit.protocols.application.httpv1.HTTP.read_http_header`, only ever +:meth:`pcapkit.protocols.application.httpv1.HTTP._read_http_header`, only ever reads ``.value`` indirectly through :meth:`~pcapkit.const.http.method.Method. get`, never ``str()`` or ``==`` against the member itself), so the change is observable only to external callers and to this module's own dunders diff --git a/tests/corekit/test_fields_copy_dispatch_unit.py b/tests/corekit/test_fields_copy_dispatch_unit.py index d055748635..29fc88a482 100644 --- a/tests/corekit/test_fields_copy_dispatch_unit.py +++ b/tests/corekit/test_fields_copy_dispatch_unit.py @@ -85,7 +85,7 @@ def assertCallReachesCopyDunderOnly(self, field: 'FieldBase[Any]') -> None: self.assertIsInstance(new_field, type(field)) def test_field_base_call_field_py_294(self) -> None: - """:meth:`FieldBase.__call__` (``field.py:294``), reached via :class:`NoValueField`. + """:meth:`FieldBase.__call__` (``field.py:281``), reached via :class:`NoValueField`. :class:`~pcapkit.corekit.fields.misc.NoValueField` is the one concrete class in this package that never overrides ``__call__``, so it is the @@ -98,19 +98,19 @@ class in this package that never overrides ``__call__``, so it is the self.assertCallReachesCopyDunderOnly(NoValueField()) def test_field_call_field_py_579(self) -> None: - """:meth:`Field.__call__` (``field.py:579``).""" + """:meth:`Field.__call__` (``field.py:581``).""" from pcapkit.corekit.fields.field import Field self.assertCallReachesCopyDunderOnly(Field(length=4)) def test_list_field_call_collections_py_84(self) -> None: - """:meth:`ListField.__call__` (``collections.py:84``).""" + """:meth:`ListField.__call__` (``collections.py:124``).""" from pcapkit.corekit.fields.collections import ListField self.assertCallReachesCopyDunderOnly(ListField(length=4)) def test_conditional_field_call_misc_py_148(self) -> None: - """:meth:`ConditionalField.__call__` (``misc.py:148``).""" + """:meth:`ConditionalField.__call__` (``misc.py:150``).""" from pcapkit.corekit.fields.field import Field from pcapkit.corekit.fields.misc import ConditionalField @@ -118,13 +118,13 @@ def test_conditional_field_call_misc_py_148(self) -> None: self.assertCallReachesCopyDunderOnly(field) def test_payload_field_call_misc_py_299(self) -> None: - """:meth:`PayloadField.__call__` (``misc.py:299``).""" + """:meth:`PayloadField.__call__` (``misc.py:351``).""" from pcapkit.corekit.fields.misc import PayloadField self.assertCallReachesCopyDunderOnly(PayloadField(length=4)) def test_switch_field_call_misc_py_427(self) -> None: - """:meth:`SwitchField.__call__` (``misc.py:427``).""" + """:meth:`SwitchField.__call__` (``misc.py:479``).""" from pcapkit.corekit.fields.field import Field from pcapkit.corekit.fields.misc import SwitchField @@ -132,7 +132,7 @@ def test_switch_field_call_misc_py_427(self) -> None: self.assertCallReachesCopyDunderOnly(field) def test_schema_field_call_misc_py_650(self) -> None: - """:meth:`SchemaField.__call__` (``misc.py:650``).""" + """:meth:`SchemaField.__call__` (``misc.py:694``).""" from pcapkit.corekit.fields.misc import SchemaField from pcapkit.corekit.fields.numbers import UInt8Field from pcapkit.protocols.schema.schema import Schema, schema_final @@ -144,7 +144,7 @@ class OneField(Schema): self.assertCallReachesCopyDunderOnly(SchemaField(schema=OneField)) def test_forward_match_field_call_misc_py_782(self) -> None: - """:meth:`ForwardMatchField.__call__` (``misc.py:782``).""" + """:meth:`ForwardMatchField.__call__` (``misc.py:849``).""" from pcapkit.corekit.fields.field import Field from pcapkit.corekit.fields.misc import ForwardMatchField diff --git a/tests/corekit/test_fields_misc_packet_context.py b/tests/corekit/test_fields_misc_packet_context.py index d7b73d10fe..8635ee3425 100644 --- a/tests/corekit/test_fields_misc_packet_context.py +++ b/tests/corekit/test_fields_misc_packet_context.py @@ -179,7 +179,7 @@ def test_nested_schema_reads_enclosing_field_by_name_and_does_not_leak_writes(se def test_pcapng_byteorder_consumer_still_works_with_both_shapes(self) -> None: """The one existing, hand-rolled ``__packet__`` fallback is unaffected. - ``packet_byteorder`` (``pcapkit/corekit/fields/byteorder.py:29``) + ``packet_byteorder`` (``pcapkit/corekit/fields/byteorder.py:28``) is called both with a plain dict built by hand -- as several tests and :func:`~pcapkit.foundation.engines.pcapng` construct -- and with what ``SchemaField`` now actually builds. Both must keep working, and diff --git a/tests/corekit/test_fields_numbers_port_option_no_mint_unit.py b/tests/corekit/test_fields_numbers_port_option_no_mint_unit.py index 0099183046..797b349303 100644 --- a/tests/corekit/test_fields_numbers_port_option_no_mint_unit.py +++ b/tests/corekit/test_fields_numbers_port_option_no_mint_unit.py @@ -9,13 +9,13 @@ return self._namespace.get(value, proto=...) -which mints a fresh member -- via :func:`aenum.extend_enum` -- for any value +which minted a fresh member -- via :func:`aenum.extend_enum` -- for any value neither an existing row nor one of the registry's own documented spans accounts for. On ``examples/captures/http.pcap`` that is 111 calls, all from ephemeral TCP ports with no IANA assignment, and measured at 13-17% of extraction self time. -Every one of those four subclasses now falls through to +Each of them now falls through to :meth:`EnumField._unregistered_member ` instead of minting: an actual instance of the registry the field names -- ``isinstance`` holds, and it renders and dispatches exactly like a declared diff --git a/tests/corekit/test_module.py b/tests/corekit/test_module.py index bdbc5d4d82..7ae9729161 100644 --- a/tests/corekit/test_module.py +++ b/tests/corekit/test_module.py @@ -241,7 +241,7 @@ def test_null_sentinel_identity_survives_copy_and_pickle(self) -> None: Each protocol's assertion also runs a second time, outside :meth:`~unittest.TestCase.subTest`, and the results are asserted - together at the end. This repository's ``pytest-subtests`` reports + together at the end. This repository's :program:`pytest` reports the *parent* test node as passed when only a ``subTest`` failed inside it -- confirmed by reproducing it directly: a single failing ``subTest`` iteration renders its own ``SUBFAILED`` line while the diff --git a/tests/corekit/test_sentinels_housing_unit.py b/tests/corekit/test_sentinels_housing_unit.py index 7986c20398..92408da3c1 100644 --- a/tests/corekit/test_sentinels_housing_unit.py +++ b/tests/corekit/test_sentinels_housing_unit.py @@ -114,7 +114,7 @@ class NoImportCycleTests(unittest.TestCase): :command:`pylint` already reports 39 ``cyclic-import`` findings in this package, so a fortieth would be invisible in the noise rather than caught. This does not run :command:`pylint` -- that check is done separately and - reported alongside this PR -- it instead pins the one fact that actually + reported alongside #922 -- it instead pins the one fact that actually rules a cycle out for this specific set of modules: that :mod:`pcapkit.corekit.sentinels` imports none of them. diff --git a/tests/foundation/engines/test_pcapng_engine.py b/tests/foundation/engines/test_pcapng_engine.py index 263d46c2f1..1a99612cb6 100644 --- a/tests/foundation/engines/test_pcapng_engine.py +++ b/tests/foundation/engines/test_pcapng_engine.py @@ -275,7 +275,7 @@ def test_read_frame_rejects_invalid_interface_contexts(self) -> None: # and ``read_frame`` is where that happens. The interface *ID* of an EPB, # ISB or obsolete Packet Block is instead bounds-checked while the block # is parsed -- see - # ``PCAPNGSectionShapeTests.test_out_of_range_interface_id_is_a_format_error`` + # ``PCAPNGSectionRuleTests.test_out_of_range_interface_id_is_a_format_error`` # for the equivalent end-to-end coverage of those three. block = FakeBlock(self._info(BlockType.Simple_Packet_Block)) diff --git a/tests/foundation/engines/test_pypcap_engine.py b/tests/foundation/engines/test_pypcap_engine.py index f29009c00d..b988858823 100644 --- a/tests/foundation/engines/test_pypcap_engine.py +++ b/tests/foundation/engines/test_pypcap_engine.py @@ -3,7 +3,7 @@ The engine itself is exercised with a stand-in for :class:`pcap.pcap`, so that the routing decisions -- format gating, capability warnings, output, storage, close -- are covered whether or not `pypcap`_ is installed. End-to-end agreement with the -``default`` engine lives in :mod:`tests.foundation.engines.test_new_engine_parity`. +``default`` engine lives in :mod:`tests.foundation.engines.test_new_engine_parity_runtime`. .. _pypcap: https://github.com/pynetwork/pypcap diff --git a/tests/foundation/engines/test_pyshark_engine.py b/tests/foundation/engines/test_pyshark_engine.py index 9182624bbe..f338e235c2 100644 --- a/tests/foundation/engines/test_pyshark_engine.py +++ b/tests/foundation/engines/test_pyshark_engine.py @@ -262,7 +262,7 @@ def test_a_config_ini_naming_an_off_path_tshark_is_not_read_as_missing(self) -> earlier version of this test asserted ``shutil.which('tshark') is None``, i.e. that the *host* has no tshark anywhere on ``PATH`` at all -- true on the machine it was written on, false on every - ``engine-tests`` CI leg once this PR's own ``apt-get install … + ``engine-tests`` CI leg once #755's own ``apt-get install … tshark`` step runs, which is exactly the asymmetry that escaped review. The claim this test actually needs is narrower: that ``which`` cannot resolve *the stand-in specifically*, because its diff --git a/tests/foundation/registry/test_protocols.py b/tests/foundation/registry/test_protocols.py index 5d0d5e6362..e19dfa46c4 100644 --- a/tests/foundation/registry/test_protocols.py +++ b/tests/foundation/registry/test_protocols.py @@ -54,7 +54,7 @@ def _guard_registry(self, registry, key) -> None: a test that writes into one has to put back exactly what it found. A plain read-and-restore is not enough: a key that was *absent* has no value to restore, and writing one back leaves a stray entry that the - next test in the process inherits -- the class of defect #674 is open + next test in the process inherits -- the class of defect #674 was opened for. Hence the sentinel and the ``pop``. """ diff --git a/tests/foundation/test_extraction_record_header_unit.py b/tests/foundation/test_extraction_record_header_unit.py index ad84155cfa..6ae5e69a04 100644 --- a/tests/foundation/test_extraction_record_header_unit.py +++ b/tests/foundation/test_extraction_record_header_unit.py @@ -8,7 +8,7 @@ :attr:`~pcapkit.foundation.extraction.Extractor.format` is set at header time, which is what makes it work on a capture with no frames. -`PyShark`_ cannot run on the 3.14 interpreter these tests use, so it is driven +`PyShark`_ cannot run on Python 3.14 or later, so it is driven through a stand-in ``pyshark`` module. .. _DPKT: https://dpkt.readthedocs.io diff --git a/tests/integration/test_engine_parity.py b/tests/integration/test_engine_parity.py index 4aa488c05d..aac5867f30 100644 --- a/tests/integration/test_engine_parity.py +++ b/tests/integration/test_engine_parity.py @@ -6,7 +6,7 @@ assertions on what each engine reports, against constants. ``pyshark`` is left out on purpose -- not for want of :program:`tshark`, which -the ``pypcap-parity`` job (the one whose selection collects this file) now +the ``pypcap-parity`` job (the one whose selection collects this file) installs, but because on Python 3.14 it fails inside its own ``get_event_loop()`` before it reads a byte, so it cannot take part in a check that runs on every version; diff --git a/tests/integration/test_pcapng_end_to_end.py b/tests/integration/test_pcapng_end_to_end.py index 336cb7b607..a14ad21fc6 100644 --- a/tests/integration/test_pcapng_end_to_end.py +++ b/tests/integration/test_pcapng_end_to_end.py @@ -184,7 +184,7 @@ def test_json_report_of_a_decryption_secrets_block_parses(self) -> None: For this fixture it is not, and two things stack up to make it so: - 1. ``pcapkit/protocols/schema/misc/pcapng.py:1982`` keys the TLS key log + 1. ``pcapkit/protocols/schema/misc/pcapng.py:2244`` keys the TLS key log entries by ``bytes.fromhex(random)``, i.e. by a raw :class:`bytes` client random rather than by its hex text, so the report's key is a Python ``bytes`` repr: ``b' !"#$%&\\'()*+,-./0123456789:;<=>?'``. @@ -205,7 +205,7 @@ def test_json_report_of_a_decryption_secrets_block_parses(self) -> None: since a stale instance of exactly this number is what #785 was filed over. The same key used to make the ``plist`` report invalid XML too; #784 fixed that half by adding an ``escape_key`` helper in - ``pcapkit/dumpkit/common.py:250`` that XML-escapes mapping keys, leaving + ``pcapkit/dumpkit/common.py:351`` that XML-escapes mapping keys, leaving only this ``json`` quoting defect, still open upstream as JarryShaw/DictDumper#121. diff --git a/tests/project/test_annotation_names.py b/tests/project/test_annotation_names.py index a4c1cf1cb9..eb248c6f52 100644 --- a/tests/project/test_annotation_names.py +++ b/tests/project/test_annotation_names.py @@ -129,11 +129,11 @@ def bound_names(tree: 'ast.AST') -> 'set[str]': against a function's locals, so narrowing to those scopes catches a real defect: a module that binds ``Optional`` as an ordinary local somewhere and then writes ``'Optional[int]'`` without importing it. But the same narrowing - false-positives on real code here, because a :func:`typing.cast` string is - resolved *lexically*, in the function containing the call -- - ``pcapkit/toolkit/scapy.py:208`` casts to ``'IPv6ExtHdrFragment'``, imported + false-positived on real code here, because a :func:`typing.cast` string is + resolved *lexically*, in the function containing the call -- until #1652, + :file:`pcapkit/toolkit/scapy.py` cast to ``'IPv6ExtHdrFragment'``, imported six lines above it inside the same function, which is correct and which mypy - accordingly does not flag. Distinguishing the two would mean tracking a + accordingly did not flag. Distinguishing the two would mean tracking a binding set per scope and knowing which construct resolves in which, i.e. reimplementing the type checker this deliberately is not. @@ -392,8 +392,8 @@ def test_a_literal_member_is_not_mistaken_for_a_type(self) -> None: def test_a_cast_to_a_function_local_import_is_not_a_finding(self) -> None: """The case that keeps :func:`bound_names` scope-blind. - ``pcapkit/toolkit/scapy.py:202-208`` imports ``IPv6ExtHdrFragment`` inside - a function and casts to it six lines later in the same function. A + Until #1652, :file:`pcapkit/toolkit/scapy.py` imported ``IPv6ExtHdrFragment`` + inside a function and cast to it six lines later in the same function. A :func:`typing.cast` string resolves lexically, so that is correct code and mypy does not flag it -- and a check narrowed to module and class scope reports it, which is how the stricter version of :func:`bound_names` was diff --git a/tests/project/test_module_isolation.py b/tests/project/test_module_isolation.py index 7fd6433603..9f46905653 100644 --- a/tests/project/test_module_isolation.py +++ b/tests/project/test_module_isolation.py @@ -5,7 +5,7 @@ three in the opposite order gave ``17 passed``. The cause was a test that bound a non-generic ``ProtocolBase`` stand-in into :data:`sys.modules` and finished without removing it, so the next test to import :mod:`pcapkit` died at -``pcapkit/protocols/misc/pcap/frame.py:59`` with ``TypeError: type 'ProtocolBase' +``pcapkit/protocols/misc/pcap/frame.py:61`` with ``TypeError: type 'ProtocolBase' is not subscriptable``. The tests here run :program:`pytest` in a subprocess over the exact selections diff --git a/tests/project/test_public_api.py b/tests/project/test_public_api.py index 60d3cb42f4..0a6b5c98bd 100644 --- a/tests/project/test_public_api.py +++ b/tests/project/test_public_api.py @@ -45,7 +45,7 @@ run by hand over :mod:`pcapkit.vendor` on a machine that *does* have the extra, across the package and its 134 public descendants. Every one of them imports, every one declares :attr:`__all__`, and every entry of every :attr:`__all__` -resolves. The single defect it holds is the duplicate described at the end of this +resolves. The single defect it held was the duplicate described at the end of this docstring, in :mod:`pcapkit.vendor` and :mod:`pcapkit.vendor.mh`. Nothing else is excluded, and no import is wrapped in a skip. That is deliberate @@ -126,16 +126,16 @@ class exists at ``pcapkit/const/mh/handover_initiate_status.py`` and is used by One gap remains, and it is recorded rather than closed because it lies outside this module's reach. :mod:`pcapkit.vendor` is excluded from the sweep for the -dependency reason above, and it carries the *same* displaced-duplicate defect in -``pcapkit/vendor/__init__.py`` and ``pcapkit/vendor/mh/__init__.py``. That one is +dependency reason above, and it carried the *same* displaced-duplicate defect in +``pcapkit/vendor/__init__.py`` and ``pcapkit/vendor/mh/__init__.py``. That one was worse than its :mod:`pcapkit.const` twin rather than merely parallel: ``pcapkit/vendor/__main__.py`` builds its crawler target list out of -``pcapkit.vendor.__all__``, so the missing ``MH_HandoverInitiateStatus`` means the -``handover_initiate_status`` crawler is absent from the default target list *and* -from ``--target mh``, and has therefore never run. Fixing it needs the ``vendor`` -extra installed to be testable here, so it belongs to a separate change; when it -lands, drop ``'vendor'`` from :data:`EXCLUDED_ROOTS` and this module will cover it -too. +``pcapkit.vendor.__all__``, so the missing ``MH_HandoverInitiateStatus`` kept the +``handover_initiate_status`` crawler out of the default target list *and* out of +``--target mh``, and it had never run. #531 fixed it, and +:mod:`tests.vendor.test_crawler_reachability_unit` guards it with the ``vendor`` +extra installed. The remaining step is to drop ``'vendor'`` from +:data:`EXCLUDED_ROOTS`, so that this module covers it too. """ from __future__ import annotations diff --git a/tests/project/test_pyshark_encap_map.py b/tests/project/test_pyshark_encap_map.py index 7e2876a0d7..741353f385 100644 --- a/tests/project/test_pyshark_encap_map.py +++ b/tests/project/test_pyshark_encap_map.py @@ -10,7 +10,7 @@ formatting that has to be byte-stable for a re-run to change nothing, and the two exclusion rules (an unmapped DLT, an ambiguous filter name) generically -- against the real :class:`~pcapkit.const.reg.linktype.LinkType` registry, whose -``_missing_`` mints a placeholder member for *any* unknown value rather than +``_missing_`` answers *any* unknown value with an unregistered placeholder rather than raising, which is itself worth pinning (#575). Most of this is unit-tier: it exercises the parsing and formatting helpers @@ -372,12 +372,12 @@ def test_rewrite_is_idempotent(self) -> None: class BuildTablesExclusionTests(unittest.TestCase): """The two exclusion rules, against the real, mutable ``LinkType`` registry. - ``LinkType``'s own ``_missing_`` mints a placeholder ``Unassigned_N`` member + ``LinkType``'s own ``_missing_`` answers with an unregistered ``Unassigned`` member for *any* value in range rather than raising (#575) -- so a naive ``try: linktype(dlt) except ValueError`` never fires, and would silently invent a table entry for a DLT the registry never actually named. These exercise :func:`~pyshark_encap_map.build_tables` against a DLT (121) picked - to be absent from the registry *right now*, which is what makes the + because the registry does not name it, which is what makes the assertion meaningful rather than assumed. """ @@ -574,7 +574,7 @@ def setUpClass(cls) -> None: raise unittest.SkipTest(f'{source} is absent') # The same value-must-already-be-registered guard build_tables() uses - # (#575): Enum_LinkType(dlt) mints a placeholder member for any value + # (#575): Enum_LinkType(dlt) answers with a placeholder member for any value # in range rather than raising, so "is this DLT really in the table" # has to be answered by membership, never by calling the constructor # first and asking forgiveness. diff --git a/tests/project/test_release_gates.py b/tests/project/test_release_gates.py index 4ec815b3b7..c787b61855 100644 --- a/tests/project/test_release_gates.py +++ b/tests/project/test_release_gates.py @@ -94,7 +94,7 @@ indentation forces onto it, measured directly against each one. Two of the three snippets run before ``actions/setup-python`` even installs a chosen version, so ``python3`` there is whatever the runner image ships by - default -- 3.12 on ``ubuntu-latest`` as of writing, never 3.14. + default -- 3.12 on ``ubuntu-latest`` when #905 measured it, never 3.14. :class:`TestPythonSnippetsSurviveOlderInterpreters` extracts each snippet and actually runs it under an interpreter older than 3.14 when one can be found on ``PATH``, skipping otherwise -- ``compile()`` under whatever @@ -3494,7 +3494,7 @@ class TestPythonSnippetsSurviveOlderInterpreters(WorkflowMixin, unittest.TestCas 3.14 -- 3.9 through 3.13 all raise ``IndentationError: unexpected indent``, measured directly. Two of the three run before ``actions/setup-python`` installs a chosen version, so ``python3`` there - is the runner image's default (3.12 on ``ubuntu-latest`` as of writing), + is the runner image's default (3.12 on ``ubuntu-latest`` when #905 measured it), never 3.14. #905's fix feeds one line per ``printf`` argument instead, so no line in the actual Python source is indented that Python did not itself put there -- this class is what actually runs each snippet under diff --git a/tests/project/test_release_tags_the_run_sha_1634.py b/tests/project/test_release_tags_the_run_sha_1634.py index 0c4176529f..f0e479f8aa 100644 --- a/tests/project/test_release_tags_the_run_sha_1634.py +++ b/tests/project/test_release_tags_the_run_sha_1634.py @@ -954,7 +954,7 @@ def test_a_conda_tag_on_another_commit_is_never_moved(self) -> None: self.assertEqual(self.remote(self.conda_tag), other) def test_a_release_tag_on_another_commit_stops_the_conda_tag(self) -> None: - """What a later run sees after a release tagged elsewhere -- 1.5.0b9 today.""" + """What a later run sees after a release tagged elsewhere, as ``v1.5.0b9`` is.""" run_sha = self.commit(self.VERSION, '0') tip = self.commit(self.VERSION, '3') self.push(tip, 'refs/heads/main') diff --git a/tests/project/test_rfc_anchor_fragments.py b/tests/project/test_rfc_anchor_fragments.py index 0f37c81745..ae0352636a 100644 --- a/tests/project/test_rfc_anchor_fragments.py +++ b/tests/project/test_rfc_anchor_fragments.py @@ -26,8 +26,8 @@ The sweep this test is built on also turned up a **second** instance of the same defect: ``:rfc:`5797#secion-2.2``` in the ``feat`` attribute docstring of the ``Command`` class (not ``FEATCode``), at -:file:`pcapkit/vendor/ftp/command.py:269` and its generated copy -:file:`pcapkit/const/ftp/command.py:257`. Same missing ``t``, same two files, +:file:`pcapkit/vendor/ftp/command.py:273` and its generated copy +:file:`pcapkit/const/ftp/command.py:261`. Same missing ``t``, same two files, same one-character fix -- fixed alongside #942's rather than carried as a documented exception. @@ -41,7 +41,7 @@ test exists to catch, the same mistake as the allowlist above one layer down. The generators that produce them, :file:`pcapkit/vendor/tcp/mp_tcp_option.py:59` and -:file:`pcapkit/vendor/reg/apptype/apptype.py:1146` (both parsing IANA's +:file:`pcapkit/vendor/reg/apptype/apptype.py:1148` (both parsing IANA's ``RFC8684, Section 3.1`` with the same ``re.fullmatch(r'RFC(?P\\d+)(, Section (?P.*?))?', ...)``, which discards the literal word ``Section`` and keeps only the number), are fixed to emit ``#section-{sec}``, and the ten diff --git a/tests/protocols/application/test_http_unit.py b/tests/protocols/application/test_http_unit.py index 40eda49c12..12ca34d8d9 100644 --- a/tests/protocols/application/test_http_unit.py +++ b/tests/protocols/application/test_http_unit.py @@ -213,9 +213,9 @@ def test_http_construction_reaches_the_versioned_make_callee(self) -> None: ``protocol.make(**kwargs)`` dispatch this issue is actually about. The real, supported entry point is construction: - :meth:`ProtocolBase.__init__` (``protocol.py:519``, the ``**kwargs``- - only overload at ``:517``) calls ``self.pack(**kwargs)`` when built - with no ``file``, and :meth:`ProtocolBase.pack` (``protocol.py:284``) + :meth:`ProtocolBase.__init__` (``protocol.py:1146``, the ``**kwargs``- + only overload at ``:1144``) calls ``self.pack(**kwargs)`` when built + with no ``file``, and :meth:`ProtocolBase.pack` (``protocol.py:750``) is ``self.__header__ = self.make(**kwargs)`` -- a *bound* call on the outer ``HTTP`` instance, which is what actually reaches the inner, previously-unbound ``protocol.make(**kwargs)``. So the reachable @@ -2160,7 +2160,7 @@ def test_httpv2_declared_length_exceeding_the_buffer_is_rejected(self) -> None: own -- regardless of how far past the real buffer it reached -- still passed the guard and reported the declared, attacker-controlled value as if the capture actually contained it. Measured pre-fix, identical on - base and the first revision of this PR: a nine-octet buffer declaring + base and the first revision of #802: a nine-octet buffer declaring 16777215 parsed and reported ``length=16777215``, overstated by 16,777,206 octets, at every one of these buffer sizes. diff --git a/tests/protocols/application/test_httpv2_payload_length_unit.py b/tests/protocols/application/test_httpv2_payload_length_unit.py index 93ce90499b..41df878b87 100644 --- a/tests/protocols/application/test_httpv2_payload_length_unit.py +++ b/tests/protocols/application/test_httpv2_payload_length_unit.py @@ -233,7 +233,7 @@ def parse(self, raw: 'bytes') -> 'Any': @unittest.skipUnless(HAS_RUNTIME, 'runtime dependencies not installed') class HTTPv2DataFramePayloadLengthUnitTests(FramePayloadMixin, unittest.TestCase): - """``DATA`` -- ``pcapkit/protocols/schema/application/httpv2.py:210``.""" + """``DATA`` -- ``pcapkit/protocols/schema/application/httpv2.py:235``.""" #: ``DATA``, :rfc:`9113#section-6.1`. TYPE = 0x00 @@ -297,7 +297,7 @@ def test_a_padded_data_frame_of_only_padding_reads_an_empty_payload(self) -> Non @unittest.skipUnless(HAS_RUNTIME, 'runtime dependencies not installed') class HTTPv2HeadersFramePayloadLengthUnitTests(FramePayloadMixin, unittest.TestCase): - """``HEADERS`` -- ``pcapkit/protocols/schema/application/httpv2.py:260``.""" + """``HEADERS`` -- ``pcapkit/protocols/schema/application/httpv2.py:284``.""" #: ``HEADERS``, :rfc:`9113#section-6.2`. TYPE = 0x01 @@ -409,7 +409,7 @@ def test_a_padded_priority_headers_frame_of_only_padding_is_empty_too(self) -> N @unittest.skipUnless(HAS_RUNTIME, 'runtime dependencies not installed') class HTTPv2PushPromiseFramePayloadLengthUnitTests(FramePayloadMixin, unittest.TestCase): - """``PUSH_PROMISE`` -- ``pcapkit/protocols/schema/application/httpv2.py:357``.""" + """``PUSH_PROMISE`` -- ``pcapkit/protocols/schema/application/httpv2.py:382``.""" #: ``PUSH_PROMISE``, :rfc:`9113#section-6.6`. TYPE = 0x05 @@ -488,14 +488,14 @@ class HTTPv2PlainLengthFormControlUnitTests(FramePayloadMixin, unittest.TestCase """ def test_continuation_frame_carries_its_fragment(self) -> None: - """``CONTINUATION`` -- ``httpv2.py:426``, the plain form.""" + """``CONTINUATION`` -- ``httpv2.py:453``, the plain form.""" raw = http2_frame_bytes(0x09, 0x04, 1, FRAGMENT) info = self.parse(raw) self.assertEqual(info.fragment, FRAGMENT) def test_goaway_frame_carries_its_debug_data(self) -> None: - """``GOAWAY`` -- ``httpv2.py:397``, the plain form.""" + """``GOAWAY`` -- ``httpv2.py:423``, the plain form.""" from pcapkit.const.http.error_code import ErrorCode payload = ((5).to_bytes(4, 'big') @@ -509,7 +509,7 @@ def test_goaway_frame_carries_its_debug_data(self) -> None: self.assertEqual(info.error, ErrorCode.ENHANCE_YOUR_CALM) def test_unassigned_frame_carries_its_data(self) -> None: - """An unregistered frame type -- ``httpv2.py:174``, the plain form. + """An unregistered frame type -- ``httpv2.py:199``, the plain form. ``0xF0`` is in the range :rfc:`9113#section-5.5` leaves for extensions, so this is expected traffic; the reader warns about it, which is why the diff --git a/tests/protocols/internet/test_hip_locator_set_length_unit.py b/tests/protocols/internet/test_hip_locator_set_length_unit.py index c83a7d64a6..a1e4e655ea 100644 --- a/tests/protocols/internet/test_hip_locator_set_length_unit.py +++ b/tests/protocols/internet/test_hip_locator_set_length_unit.py @@ -46,7 +46,7 @@ =================== ============== ====== ========================= Four of the seven were not even multiples of eight. A sweep over n = 1..5 of -plain locators passes today by cancellation and would pass a half-fix too, so it +plain locators passed by cancellation before the fix and would pass a half-fix too, so it discriminates nothing; the empty set, the SPI-bearing variant and a mixed set in both orders are the shapes that do. diff --git a/tests/protocols/internet/test_hip_unit.py b/tests/protocols/internet/test_hip_unit.py index 05e2e99429..760a4bdb1d 100644 --- a/tests/protocols/internet/test_hip_unit.py +++ b/tests/protocols/internet/test_hip_unit.py @@ -2691,7 +2691,7 @@ def test_hip_puzzle_and_solution_keep_the_on_wire_field_width(self) -> None: self.assertNotEqual(rebuilt.len, 6) # what the unfixed builder produced # Compared without the trailing padding, and then against the re-packed # source schema rather than against the literal. Both are deliberate: the - # padding rule is itself in flight (#651/#664), and this test is about the + # padding rule is pinned separately (#651/#664), and this test is about the # `Length` field and the payload octets, not about how many alignment octets # follow them. Either assertion alone would be weaker -- the first pins the # octets that came off the wire, the second pins losslessness end to end. @@ -2782,7 +2782,7 @@ def test_hip_solution_second_octet_is_reserved_not_a_lifetime(self) -> None: # Compared against the re-packed source schema rather than against the # literal, and with the trailing padding excluded, for the reason given in # `test_hip_puzzle_and_solution_keep_the_on_wire_field_width`: the padding - # rule is in flight (#651/#664) and is not what this test is about. + # rule is pinned separately (#651/#664) and is not what this test is about. conformant = bytes.fromhex('0141' '0014' '01' '00' '6f70' '8000000000000000' '8000000000000000' '00000000') conformant_schema = hip_schema.SolutionParameter.unpack(conformant) diff --git a/tests/protocols/internet/test_ipv6_ext_unit.py b/tests/protocols/internet/test_ipv6_ext_unit.py index b204877be6..d206b254e5 100644 --- a/tests/protocols/internet/test_ipv6_ext_unit.py +++ b/tests/protocols/internet/test_ipv6_ext_unit.py @@ -576,7 +576,7 @@ def test_every_subclass_index_returns_a_real_transtype(self) -> None: def test_every_subclass_alias_survives_the_packet_dict_key_computation(self) -> None: """:meth:`IPv6._decode_next_layer ` keys its - packet dict by ``alias.lstrip('IPv6-').lower()`` (``ipv6.py:391``). + packet dict by ``alias.lstrip('IPv6-').lower()`` (``ipv6.py:436``, in ``_exthdr_key``). :meth:`str.lstrip` strips a character *set*, so the hyphen in ``IPv6-Route``/``IPv6-Frag``/``IPv6-Opts`` is what lets ``IPv6`` fall away cleanly, where the underscore of a class-name default like diff --git a/tests/protocols/internet/test_mh_unit.py b/tests/protocols/internet/test_mh_unit.py index 852926a7fb..8fbc307b42 100644 --- a/tests/protocols/internet/test_mh_unit.py +++ b/tests/protocols/internet/test_mh_unit.py @@ -2952,7 +2952,7 @@ def test_mh_bool_is_still_a_valid_value_for_an_integer_field(self) -> None: ``NonceIndicesOption.home`` is a :class:`~pcapkit.corekit.fields.numbers.UInt16Field` at - ``pcapkit/protocols/schema/internet/mh.py:670`` -- a nonce *index* rather + ``pcapkit/protocols/schema/internet/mh.py:708`` -- a nonce *index* rather than an address -- so ``home=True`` packing as ``1`` is correct, not a defect. ``BindingRevocationMessage.code`` makes the same point through a :class:`~pcapkit.corekit.fields.misc.SwitchField`, which is why the guard diff --git a/tests/protocols/misc/test_pcapng_unit.py b/tests/protocols/misc/test_pcapng_unit.py index 49957bf896..d343ee129c 100644 --- a/tests/protocols/misc/test_pcapng_unit.py +++ b/tests/protocols/misc/test_pcapng_unit.py @@ -1414,7 +1414,7 @@ def test_tls_key_label_tracks_rfc_9850_plus_documented_rsa_exception(self) -> No # Every member's value pinned exactly -- this is a value-matched # registry (``TLSKeyLabel(label.upper())`` at - # pcapkit/protocols/schema/misc/pcapng.py:2108), so the value, not + # pcapkit/protocols/schema/misc/pcapng.py:2243), so the value, not # merely the name, is what callers depend on. for name in expected: with self.subTest(name=name): diff --git a/tests/protocols/schema/test_schema_metaclass_abc_cache_unit.py b/tests/protocols/schema/test_schema_metaclass_abc_cache_unit.py index 37638b3035..6649957c4f 100644 --- a/tests/protocols/schema/test_schema_metaclass_abc_cache_unit.py +++ b/tests/protocols/schema/test_schema_metaclass_abc_cache_unit.py @@ -241,7 +241,7 @@ def test_the_pcapng_1248_symptom_no_longer_reproduces(self) -> None: :meth:`NameResolutionBlock.post_process ` asks ``isinstance(record, (IPv4Record, IPv6Record))`` at - :file:`pcapkit/protocols/schema/misc/pcapng.py:1248` and then reads + :file:`pcapkit/protocols/schema/misc/pcapng.py:1870` and then reads ``record.names``. Before #439 was fixed, every schema class shared one ``_abc_impl``, so that question answered ``True`` for the block's *terminating* ``EndRecord`` -- which has no ``names`` -- provided diff --git a/tests/protocols/test_construction_keyword_check_unit.py b/tests/protocols/test_construction_keyword_check_unit.py index cab5bc32c3..613f485c7e 100644 --- a/tests/protocols/test_construction_keyword_check_unit.py +++ b/tests/protocols/test_construction_keyword_check_unit.py @@ -61,8 +61,8 @@ warns where a caller would be raised at, because the keywords it spreads came out of :meth:`ProtocolBase._make_data ` rather than out of anybody's -editor. Three protocols have a mismatch of exactly that kind today and have been -losing a field to it in silence; they are recorded there. +editor. Mismatches of exactly that kind have lost fields in silence (#1097), so +the case there builds its own rather than depending on a real one. This module is unit tier: it constructs its own octets and reads no capture, so it runs on a fresh checkout with nothing generated. @@ -289,10 +289,10 @@ def test_the_exception_is_the_one_the_library_already_uses(self) -> None: Not a new exception type: the library already answers "you passed a keyword I do not accept" with :exc:`~pcapkit.utilities.exceptions.UnsupportedCall`, in five places with - this exact message shape -- ``protocol.py:1064``, - ``dumpkit/common.py:142``, ``foundation/reassembly/reassembly.py:580``, - ``foundation/engines/engine.py:313`` and - ``foundation/traceflow/traceflow.py:514``. Reusing it keeps one answer to + this exact message shape -- ``protocol.py:1412``, + ``dumpkit/common.py:168``, ``foundation/reassembly/reassembly.py:587``, + ``foundation/engines/engine.py:314`` and + ``foundation/traceflow/traceflow.py:555``. Reusing it keeps one answer to one question rather than adding a second. The honest caveat, recorded so it is a decision rather than an oversight: diff --git a/tests/protocols/transport/test_tcp_http_dispatch_unit.py b/tests/protocols/transport/test_tcp_http_dispatch_unit.py index 3511d03292..f5c61bee58 100644 --- a/tests/protocols/transport/test_tcp_http_dispatch_unit.py +++ b/tests/protocols/transport/test_tcp_http_dispatch_unit.py @@ -88,7 +88,7 @@ def test_http2_on_the_http_ports_decodes_as_http2_and_http1_still_as_http1(self) The HTTP/2 half is what the repoint buys: before it, these nine octets decoded as ``TCP:Raw``, because ``httpv1.HTTP`` refused them and - :func:`~pcapkit.protocols.misc.raw.beholder` turned the refusal into + :func:`~pcapkit.corekit.decorators.beholder` turned the refusal into ``Raw``. The HTTP/1.1 half is the guard on the 231 HTTP/1.1 frames in the fixture corpus that this change routes through :meth:`HTTP._guess_version diff --git a/tests/protocols/transport/test_tcp_mptcp_error_message_unit.py b/tests/protocols/transport/test_tcp_mptcp_error_message_unit.py index a6bb2fdaf4..c37e85310d 100644 --- a/tests/protocols/transport/test_tcp_mptcp_error_message_unit.py +++ b/tests/protocols/transport/test_tcp_mptcp_error_message_unit.py @@ -11,11 +11,11 @@ is the string a user sees when an MP_JOIN or DSS option is rejected, and an empty field reads as a value that failed to interpolate. -The correct form is not a matter of taste. The same file spells the same prefix -without the doubling in 28 other places, all +The correct form is not a matter of taste. When #649 was fixed, the same file +spelled the same prefix without the doubling in 28 other places, all ``f'{self.alias}: [OptNo {schema.kind}] …'``, so the four were outliers against a -house form in their own module; the fix moves them into it and the count becomes -32. Two sibling test modules already quote the single-separator form in their +house form in their own module; the fix moved them into it and the count became +32. Two sibling test modules already quoted the single-separator form in their docstrings, which is further evidence of what was intended. Every message here is asserted **in full** rather than by substring. That is the @@ -23,10 +23,10 @@ passes both before and after it, so the two places that already exercise these messages could not have caught this, and needed no edit -- -* ``test_tcp_mptcp_join_flag_ordering_unit.py:404``, which asserts +* ``test_tcp_mptcp_join_flag_ordering_unit.py:423``, which asserts ``assertIn('invalid flags combination', str(caught.exception))`` against ``_make_mptcp_join``, and -* ``test_tcp_udp_unit.py:1629``, which asserts +* ``test_tcp_udp_unit.py:1632``, which asserts ``assertRaisesRegex(ProtocolError, 'invalid flags combination')`` against ``_read_mptcp_join``. @@ -34,7 +34,7 @@ pass unchanged. Neither module is touched by this change. All four lines arrived together in ``3bba8a1748`` (2023-04-10) and were untouched -until now. +until #649. """ from __future__ import annotations diff --git a/tests/protocols/transport/test_tcp_mptcp_join_flag_ordering_unit.py b/tests/protocols/transport/test_tcp_mptcp_join_flag_ordering_unit.py index 34403ccc84..762425807f 100644 --- a/tests/protocols/transport/test_tcp_mptcp_join_flag_ordering_unit.py +++ b/tests/protocols/transport/test_tcp_mptcp_join_flag_ordering_unit.py @@ -27,7 +27,7 @@ The parse path has the identical pair of branches in ``_read_mptcp_join`` and is fine, because :meth:`~pcapkit.protocols.transport.tcp.TCP.read` assigns ``self._flags`` at -``tcp.py:485``, before it parses the options at ``tcp.py:494``. Only the make path was +``tcp.py:510``, before it parses the options at ``tcp.py:530``. Only the make path was inverted. The fix is the hoist: the ``flags`` dict and the ``_flag`` accumulation move above the @@ -104,7 +104,7 @@ The read path was checked for the same shape of problem and does **not** have it: :func:`~pcapkit.protocols.schema.transport.tcp.mptcp_data_selector` guards the flagless -case at ``schema/transport/tcp.py:204-212`` and raises +case at ``schema/transport/tcp.py:242-250`` and raises :exc:`~pcapkit.utilities.exceptions.FieldError` before ``_read_mptcp_join`` is reached at all, so its own closing ``ProtocolError`` stays unreachable and its ``cast('Enum_Flags', 0)`` is left alone. Changing it would alter the ``connection`` value diff --git a/tests/protocols/transport/test_tcp_mptcp_length_unit.py b/tests/protocols/transport/test_tcp_mptcp_length_unit.py index 7f919d08f0..815a818271 100644 --- a/tests/protocols/transport/test_tcp_mptcp_length_unit.py +++ b/tests/protocols/transport/test_tcp_mptcp_length_unit.py @@ -41,24 +41,25 @@ enclosing :class:`~pcapkit.corekit.fields.collections.OptionField` stops at the end-of-option-list marker or at the declared options length whichever comes first, so the over-read is absorbed rather than reported. And the construction -path never evaluates the field at all -- every ``tcp-mptcp/*`` case in -:data:`tests.protocols.test_option_roundtrip_unit.EXPECTED_FAILURES` fails before -reaching it, for reasons of its own that #553 does not touch. +path never evaluated the field at all -- when #553 was fixed, every +``tcp-mptcp/*`` case in +:data:`tests.protocols.test_option_roundtrip_unit.EXPECTED_FAILURES` failed before +reaching it, for reasons of its own that #553 did not touch. So the assertion here is deliberately on the *decoded namespace* rather than on a -round trip. A full parse of an MP_CAPABLE option does not complete on ``main`` -either: :class:`MPTCPCapable -` gates ``rkey`` on -``pkt['length'] != 32`` while the nested subtype schemas declare no ``length`` -field, so parsing raises ``KeyError: 'length'`` from +round trip. A full parse of an MP_CAPABLE option did not complete then either: +:class:`MPTCPCapable +` gated ``rkey`` on +``pkt['length'] != 32`` while the nested subtype schemas declared no ``length`` +field, so parsing raised ``KeyError: 'length'`` from :file:`pcapkit/protocols/schema/transport/tcp.py` regardless of which bit offset -the header used. That is the structural defect behind #541 and the eight +the header used. That was the structural defect behind #541 and the eight ``tcp-mptcp/*`` expected failures -- the subtype schemas inherit :class:`MPTCP -`, which declares ``kind`` and +`, which declared ``kind`` and ``length`` only under :data:`~typing.TYPE_CHECKING` -- and it is not what #553 -is about. Tying this assertion to an end-to-end parse would mean it could not be -written until that much larger change landed, and the bit offset would stay -wrong in the meantime. +is about. Tying this assertion to an end-to-end parse would have meant it could +not be written until that much larger change landed, and the bit offset would +have stayed wrong in the meantime. The field is read off the schema class, ``_MPTCP.__fields__['test']``, rather than rebuilt here, so the declaration under test is the one the library ships. diff --git a/tests/protocols/transport/test_tcp_mptcp_subtype_unit.py b/tests/protocols/transport/test_tcp_mptcp_subtype_unit.py index b3bbaf4e20..160a2bad5b 100644 --- a/tests/protocols/transport/test_tcp_mptcp_subtype_unit.py +++ b/tests/protocols/transport/test_tcp_mptcp_subtype_unit.py @@ -211,7 +211,7 @@ def test_dss_subtype_round_trips(self) -> None: """``DSS`` built through ``TCP()`` reports its own subtype. ``ack`` alone (no ``dsn``) keeps clear of the unrelated length-arithmetic defect - tracked as #576, which is not what this test is about. + that #576 fixed, which is not what this test is about. """ from pcapkit.const.tcp.mp_tcp_option import MPTCPOption as Enum_MPTCPOption diff --git a/tests/test_docstring_contract.py b/tests/test_docstring_contract.py index 3104591a9b..d1fc37726f 100644 --- a/tests/test_docstring_contract.py +++ b/tests/test_docstring_contract.py @@ -385,22 +385,26 @@ def _raised_names(node: 'ast.AST') -> 'set[str]': * Only :class:`ast.Name` and :class:`ast.Attribute` raise targets are resolved, so a computed ``raise REGISTRY[code]`` would register neither as a matching raise nor, in :func:`_calls_anything_callable`, as a call. - Currently inert: across ``pcapkit/`` the 858 raise targets break down as - 856 ``Name`` and 2 ``Attribute``, and **no** ``Subscript``. + Inert: across ``pcapkit/`` the 1,060 raise targets break down as + 1,058 ``Name`` and 2 ``Attribute``, and **no** ``Subscript``. * :func:`ast.walk` descends into nested ``def``\\ s, so a ``raise`` inside a - local helper is attributed to the function enclosing it. 11 documented - functions contain a nested ``def`` and 3 of those raise inside it. + local helper is attributed to the function enclosing it. 19 documented + functions contain a nested ``def`` and 6 of those raise inside it. - That second one reads like a bug and is in fact the right answer here, which - is why it is left alone. In all three cases the nested ``def`` is a local - helper the enclosing body actually calls, so the exception really does - propagate out of the enclosing function: :meth:`HIP._read_param_locator_set + That second one reads like a bug and is the right answer for a nested + ``def`` that is a local helper the enclosing body actually calls, so the + exception really does propagate out of the enclosing function: + :meth:`HIP._read_param_locator_set ` documents ``ProtocolError`` and raises none itself, but its ``_read_locator`` helper does and it calls that helper once per locator. Attributing the raise - outward is therefore correct, and the clause is not a phantom. It would only - mislead for a nested ``def`` that is *returned* rather than called, which - this package does not currently do. + outward is therefore correct there, and the clause is not a phantom. It can + mislead for a nested ``def`` that is *returned* rather than called, and four + of the six are: the wrappers inside + :func:`~pcapkit.corekit.decorators.prepare` and + :mod:`pcapkit.protocols.schema.misc.pcapng`'s ``bounded_option``, and the + methods of the classes :func:`~pcapkit.dumpkit.common.make_dumper` and the + Scapy engine's ``_reader_type`` build. """ raised = set() # type: set[str] diff --git a/tests/test_support_helpers.py b/tests/test_support_helpers.py index 59331e7ac9..43c240c956 100644 --- a/tests/test_support_helpers.py +++ b/tests/test_support_helpers.py @@ -497,7 +497,7 @@ def test_protochain_leaves_no_fake_protocol_module_behind(self) -> None: def test_the_real_protocol_base_still_subscripts_afterwards(self) -> None: """The failure mode itself, rather than the table it came from. - ``pcapkit/protocols/misc/pcap/frame.py:59`` is the line that raised + ``pcapkit/protocols/misc/pcap/frame.py:61`` is the line that raised ``TypeError: type 'ProtocolBase' is not subscriptable``, so importing it after the polluting test case has run is the most direct statement of what #660 was. diff --git a/tests/toolkit/test_scapy_unit.py b/tests/toolkit/test_scapy_unit.py index 40d6403d4d..27b949e453 100644 --- a/tests/toolkit/test_scapy_unit.py +++ b/tests/toolkit/test_scapy_unit.py @@ -124,7 +124,7 @@ def _make_ether_raw(self): def _make_ip_rooted_tcp_packet(self): # No Ether layer, so ``packet.name`` (what #775's tier 1 fix at - # scapy.py:324 feeds ``Enum_LinkType.get()``) is ``'IP'`` -- not a + # scapy.py:716 feeds ``Enum_LinkType.get()``) is ``'IP'`` -- not a # LinkType member name, unlike the Ether-rooted packets above whose # name is ``'Ethernet'``. from scapy.layers.inet import IP, TCP diff --git a/tests/vendor/test_crawler_reachability_unit.py b/tests/vendor/test_crawler_reachability_unit.py index b84398ba18..725f1a0725 100644 --- a/tests/vendor/test_crawler_reachability_unit.py +++ b/tests/vendor/test_crawler_reachability_unit.py @@ -7,9 +7,9 @@ .. code-block:: python - # pcapkit/vendor/__main__.py:79, the `--target ` path + # pcapkit/vendor/__main__.py:230, the `--target ` path target_list.extend(getattr(module, name) for name in module.__all__) - # pcapkit/vendor/__main__.py:87, the default path, i.e. a bare `pcapkit-vendor` + # pcapkit/vendor/__main__.py:238, the default path, i.e. a bare `pcapkit-vendor` target_list.extend(getattr(vendor_module, name) for name in vendor_module.__all__) :attr:`pcapkit.vendor.__all__` listed ``'MH_HandoverACKStatus'`` *twice* and had @@ -18,13 +18,13 @@ :file:`pcapkit/vendor/mh/__init__.py`. So both the default target list and ``--target mh`` were missing ``handover_initiate_status``, and that crawler had never run: :file:`.github/workflows/cron-vendor.yml` invokes bare -``pcapkit-vendor``, which is exactly the line 87 path. +``pcapkit-vendor``, which is exactly the default path. -The corroborating evidence is in the generated file the crawler owns. -:meth:`pcapkit.vendor.default.Vendor.context` emits a ``:meta private:`` -directive into every enumeration it writes -(:file:`pcapkit/vendor/default.py:70`), and 116 of the 117 files under -:file:`pcapkit/const/*/` carry it. The one that does not is +The corroborating evidence was in the generated file the crawler owns. +:meth:`pcapkit.vendor.default.Vendor.context` emitted a ``:meta private:`` +directive into every enumeration it wrote until #858 replaced the template, +and 116 of the 117 files under :file:`pcapkit/const/*/` carried it. The one +that did not was :file:`pcapkit/const/mh/handover_initiate_status.py` -- the output of the one crawler that could not be reached. The duplicate dates to commit ``24edd30d2`` (2023-04-17, "added MH enumerations & vendor cralwers"), so the file has been @@ -46,9 +46,9 @@ ``EXCLUDED_ROOTS``, because it is unit-tier and the ``vendor`` extra is not part of ``pip install -e '.[test]'``. Its docstring records the remediation as "drop ``'vendor'`` from :data:`EXCLUDED_ROOTS`". This module is a separate file -rather than that edit, for two reasons: #527 is not merged, so its file does not -exist on the branch this change is cut from; and the assertion here is not the one -it makes. It needs the ``vendor`` extra, and the property it checks -- defined +rather than that edit, for two reasons: #527 had not merged when this module was +written, so its file did not exist on that branch; and the assertion here is not +the one it makes. It needs the ``vendor`` extra, and the property it checks -- defined versus reachable -- is about the crawler *registry* rather than about :attr:`__all__` hygiene. Dropping the exclusion is still worth doing on top of this, and would give the duplicate a second, cheaper detector. diff --git a/tests/vendor/test_re_sub_positional_flag_unit.py b/tests/vendor/test_re_sub_positional_flag_unit.py index 5ab97e558e..40ac281fb0 100644 --- a/tests/vendor/test_re_sub_positional_flag_unit.py +++ b/tests/vendor/test_re_sub_positional_flag_unit.py @@ -379,7 +379,7 @@ def _assert_no_deprecation(self, module_name: 'str', class_name: 'str', instance.process(rows) # type: ignore[attr-defined] def test_default_process_no_deprecation(self) -> None: - # pcapkit/vendor/default.py:343 -- the shared base implementation, + # pcapkit/vendor/default.py:348 -- the shared base implementation, # inherited by every crawler that does not override process(), e.g. # pcapkit.vendor.arp.hardware.Hardware. self._assert_no_deprecation( diff --git a/tests/vendor/test_vendor_dest_path_unit.py b/tests/vendor/test_vendor_dest_path_unit.py index 3d7cd7c5a5..6684f780a1 100644 --- a/tests/vendor/test_vendor_dest_path_unit.py +++ b/tests/vendor/test_vendor_dest_path_unit.py @@ -19,8 +19,8 @@ os.makedirs(os.path.join(ROOT, '..', 'const', STEM), exist_ok=True) with open(os.path.join(ROOT, '..', 'const', STEM, FILE), 'w') as file: -That is correct only because every crawler today sits exactly one level under -``vendor/``, e.g. :mod:`pcapkit.vendor.reg.apptype` writes +That was correct only because every crawler then sat exactly one level under +``vendor/``, e.g. :mod:`pcapkit.vendor.reg.apptype` wrote :file:`pcapkit/const/reg/apptype.py`. Traced by hand for a module one level deeper -- :file:`pcapkit/vendor/reg/apptype/tcp.py`, the shape #732 needs -- ``temp`` is :file:`.../vendor/reg/apptype`, so ``ROOT`` becomes @@ -49,10 +49,11 @@ Three things are pinned: * :class:`ExistingCrawlerDestPathTests` -- the regression guard. Every crawler - discovered under :mod:`pcapkit.vendor` today is depth-one, and each must still - resolve to exactly the :file:`const/` file it writes today; this is the "did - not move" half of the contract, checked by enumerating the real crawlers on - disk rather than sampling a couple by name. + discovered under :mod:`pcapkit.vendor` must resolve to exactly the + :file:`const/` file it writes -- the depth-one ones by the pre-fix formula, + the five #732 nests under :file:`vendor/reg/apptype/` by the mirrored path; + this is the "did not move" half of the contract, checked by enumerating the + real crawlers on disk rather than sampling a couple by name. * :class:`NestedCrawlerDestPathTests`\\ 's :meth:`~NestedCrawlerDestPathTests.test_nested_module_resolves_under_const` -- the case that motivated the fix. A stub crawler is built two levels @@ -93,7 +94,7 @@ nothing here reaches -- no test in this file calls :meth:`Vendor.__init__` or :meth:`~Vendor.context`. ``requests`` and ``beautifulsoup4`` both ship in the ``test`` extra precisely so vendor tests can run (:file:`pyproject.toml`, -around line 243), so both classes below run on ``test``, ``engine-tests`` +around line 321), so both classes below run on ``test``, ``engine-tests`` and ``gate`` -- the only three pytest jobs of :file:`.github/workflows/unit-tests.yml` that collect anything under :file:`tests/vendor/` at all, since ``integration`` and ``pypcap-parity`` diff --git a/tests/vendor/test_vendor_ipv6_extension_header_925_unit.py b/tests/vendor/test_vendor_ipv6_extension_header_925_unit.py index b6ac80a33e..06e13e58a0 100644 --- a/tests/vendor/test_vendor_ipv6_extension_header_925_unit.py +++ b/tests/vendor/test_vendor_ipv6_extension_header_925_unit.py @@ -54,7 +54,7 @@ issue's own investigation fetched reproduces the committed const file byte-for-byte. The owner should still run the crawler for real once, to confirm the *live* registry matches the fixture -- IANA could have edited -the registry between the fetch and this PR landing. +the registry between the fetch and #926 landing. """ from __future__ import annotations diff --git a/tests/vendor/test_vendor_missing_body_unit.py b/tests/vendor/test_vendor_missing_body_unit.py index cf7f20ea42..c3031e9e78 100644 --- a/tests/vendor/test_vendor_missing_body_unit.py +++ b/tests/vendor/test_vendor_missing_body_unit.py @@ -22,7 +22,7 @@ The invariant is deliberately not "every emitted line returns": the base crawler itself emits legitimate non-returning lines for a range-guarded body. :meth:`pcapkit.vendor.default.Vendor.process` (see -:file:`pcapkit/vendor/default.py:341-343`) renders such a body as three +:file:`pcapkit/vendor/default.py:397-399`) renders such a body as three lines -- an ``if`` header, a ``#:`` comment, then an indented ``return`` -- and only the third of the three returns:: diff --git a/tests/vendor/test_vendor_reg_apptype_generator_unit.py b/tests/vendor/test_vendor_reg_apptype_generator_unit.py index e783693851..216deb72df 100644 --- a/tests/vendor/test_vendor_reg_apptype_generator_unit.py +++ b/tests/vendor/test_vendor_reg_apptype_generator_unit.py @@ -106,7 +106,7 @@ which #766 carries for the sibling isort check. What the gate is worth has not changed. mypy is a :file:`Pipfile` -``[dev-packages]`` entry (line 48) and is in no :file:`pyproject.toml` extra, +``[dev-packages]`` entry (line 50) and is in no :file:`pyproject.toml` extra, so no ``pytest`` job in :file:`.github/workflows/unit-tests.yml` -- every one installs ``.[test,...]`` -- ever has it importable, and this test skips on all of them; it runs where mypy is installed, which is a developer checkout and diff --git a/tests/vendor/test_vendor_snapshot_restore_unit.py b/tests/vendor/test_vendor_snapshot_restore_unit.py index df59c22b2e..a50cdec5dd 100644 --- a/tests/vendor/test_vendor_snapshot_restore_unit.py +++ b/tests/vendor/test_vendor_snapshot_restore_unit.py @@ -156,7 +156,7 @@ :exc:`PermissionError`, and the previous content survives untouched because ``vendor()`` is never even called. This is not new relative to rounds 4-8 (``os.replace()`` needed directory write too), only relative to `main`, so -the PR now discloses two traded capabilities rather than one. See +#873 discloses two traded capabilities rather than one. See :func:`~pcapkit.vendor.__main__._snapshot_and_restore`'s own docstring for the asymmetry between this and the ``0o444`` case: a ``_dest_path`` resolution failure *skips* the snapshot and lets the target proceed