diff --git a/pcapkit/foundation/registry/protocols.py b/pcapkit/foundation/registry/protocols.py index 2c92d7f3f..459e2d03e 100644 --- a/pcapkit/foundation/registry/protocols.py +++ b/pcapkit/foundation/registry/protocols.py @@ -221,7 +221,7 @@ class rather than supplied by a caller, and this function is the funnel if not isinstance(protocol, type): raise RegistryError(f'protocol must be a class, not {protocol!r}') if not issubclass(protocol, ProtocolBase): - raise RegistryError(f'protocol must be a ProtocolBase subclass, not {protocol!r}') + raise RegistryError(f'protocol must be a Protocol subclass, not {protocol!r}') name = protocol.__name__.upper() incumbent = protocol_registry.get(name) diff --git a/pcapkit/protocols/protocol.py b/pcapkit/protocols/protocol.py index a96df0ec2..75b04a49f 100644 --- a/pcapkit/protocols/protocol.py +++ b/pcapkit/protocols/protocol.py @@ -1139,7 +1139,7 @@ def _next_layer_entry(cls, code: 'Any', protocol: 'ModuleDescriptor[ProtocolBase if not isinstance(protocol, type): raise RegistryError(f'protocol must be a class, not {protocol!r}') if not issubclass(protocol, ProtocolBase): - raise RegistryError(f'protocol must be a ProtocolBase subclass, not {protocol!r}') + raise RegistryError(f'protocol must be a Protocol subclass, not {protocol!r}') return protocol @classmethod diff --git a/tests/foundation/reassembly/test_deferred_pickle_2423_unit.py b/tests/foundation/reassembly/test_deferred_pickle_2423_unit.py index 7ab929a54..1463d3b7e 100644 --- a/tests/foundation/reassembly/test_deferred_pickle_2423_unit.py +++ b/tests/foundation/reassembly/test_deferred_pickle_2423_unit.py @@ -245,7 +245,7 @@ def test_setstate_still_accepts_the_first_revisions_flat_shape(self) -> None: """The flat ``{slot: value}`` shape the very first fix returned. Never released, but already pushed in an earlier revision of - :issue:`2424`'s fix -- accepting it costs nothing and protects anyone + :issue:`2423`'s fix -- accepting it costs nothing and protects anyone who pickled against that revision. """ diff --git a/tests/foundation/registry/test_protocols.py b/tests/foundation/registry/test_protocols.py index 830a7db3c..c9132109a 100644 --- a/tests/foundation/registry/test_protocols.py +++ b/tests/foundation/registry/test_protocols.py @@ -438,7 +438,7 @@ def test_register_protocol_rejects_a_non_class_with_registry_error(self) -> None ('none', None, 'must be a class'), ('descriptor argument (not unwrapped here)', ModuleDescriptor('pcapkit.protocols.misc.raw', 'Raw'), 'must be a class'), - ('wrong class', object, 'ProtocolBase subclass'), + ('wrong class', object, 'Protocol subclass'), ): with self.subTest(value=label): with self.assertRaises(RegistryError) as caught: diff --git a/tests/protocols/test_register_class_guard_unit.py b/tests/protocols/test_register_class_guard_unit.py index 853476a38..334fb469f 100644 --- a/tests/protocols/test_register_class_guard_unit.py +++ b/tests/protocols/test_register_class_guard_unit.py @@ -82,7 +82,7 @@ def test_wrong_class_still_raises_registry_error(self) -> None: with mock.patch.dict(klass.__proto__): with self.assertRaises(RegistryError) as caught: klass.register(code, dict) # type: ignore[arg-type] - self.assertIn('ProtocolBase subclass', str(caught.exception)) + self.assertIn('Protocol subclass', str(caught.exception)) def test_descriptor_naming_a_non_class_raises_registry_error(self) -> None: from pcapkit.corekit.module import ModuleDescriptor @@ -107,7 +107,7 @@ def test_descriptor_naming_a_wrong_class_still_raises_registry_error(self) -> No with mock.patch.dict(klass.__proto__): with self.assertRaises(RegistryError) as caught: klass.register(code, descriptor) # type: ignore[arg-type] - self.assertIn('ProtocolBase subclass', str(caught.exception)) + self.assertIn('Protocol subclass', str(caught.exception)) def test_valid_class_and_descriptor_still_register(self) -> None: from pcapkit.corekit.module import ModuleDescriptor