Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tests/const/test_const_enum_no_mint.py
Original file line number Diff line number Diff line change
Expand Up @@ -1482,8 +1482,8 @@ class EtherTypeMixedMintTests(unittest.TestCase):
Unassigned`` and the "Old Xerox Experimental..." row, and #775 converts
every attributed vendor block (a real company's own name for its own
code) too, so no branch mints -- ``EtherType(0x0888)`` resolves to an
unregistered ``Xyplex_0x0888``. :meth:`test_formerly_attributed_vendor_block_
no_longer_mints` below pins that one named probe (``Xyplex``)."""
unregistered ``Xyplex_0x0888``. :meth:`test_an_attributed_vendor_block_does_not_mint`
below pins that one named probe (``Xyplex``)."""

def setUp(self) -> None:
reimport_once_per_class(self, restore=True)
Expand Down Expand Up @@ -2046,7 +2046,7 @@ def test_method_get_unknown_does_not_mint(self) -> None:
self.assertEqual(different_case, 'PYPCAPKIT860PROBE2')
self.assertNotEqual(first, different_case)

def test_registered_lookups_are_still_unaffected(self) -> None:
def test_registered_words_resolve_to_their_registered_members(self) -> None:
"""A word IANA already assigned still resolves to the same,
genuinely-registered, identical member every time -- this
conversion only changes what happens for a word that is not one of
Expand Down
11 changes: 5 additions & 6 deletions tests/const/test_const_method_value_lookup_908_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def test_an_exact_name_match_still_wins_and_ignores_a_supplied_default(self) ->
class PreservedBehaviourTests(unittest.TestCase):
"""The two settled behaviours the fix must not disturb."""

def test_case_sensitivity_from_896_still_holds(self) -> None:
def test_get_matches_names_case_sensitively(self) -> None:
"""RFC 9110 Section 9.1, via GitHub issue #896: a name match is
case-**sensitive**, so ``get('get')`` must not resolve to
:attr:`Method.GET`. Fails against a naive fix that resolves ``key``
Expand Down Expand Up @@ -158,7 +158,7 @@ class DefaultSignatureTests(unittest.TestCase):
rather than widening to the base's ``NO_DEFAULT`` sentinel -- see the
module docstring's reasoning."""

def test_default_still_names_the_unregistered_members_value(self) -> None:
def test_default_names_the_unregistered_members_value(self) -> None:
"""Omitted or ``None``, ``default`` uses ``key`` itself; supplied,
it replaces the *value* of the freshly minted unregistered member --
the same with or without #908's fix, and distinct from the base's own
Expand All @@ -177,10 +177,9 @@ def test_default_still_names_the_unregistered_members_value(self) -> None:

self.assertEqual(len(Method.__members__), before)

def test_get_is_now_a_classmethod_bound_the_same_way_for_callers(self) -> None:
"""The ``staticmethod`` -> ``classmethod`` switch GitHub issue #908's
own correction required is invisible to a caller: ``Method.get('X')``
binds identically either way."""
def test_get_is_a_classmethod_that_binds_to_the_class(self) -> None:
"""``get`` is a ``classmethod``, the shape GitHub issue #908's own
correction required, and ``Method.get('X')`` binds to the class."""
from pcapkit.const.http.method import Method

self.assertIsInstance(inspect.getattr_static(Method, 'get'), classmethod)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def test_a_documented_span_still_mints_its_own_bounded_member(self) -> None:
self.assertEqual(resolved.svc, 'reserved')
self.assertEqual(resolved.port, 230)

def test_an_out_of_width_port_still_raises_764s_rejection(self) -> None:
def test_an_out_of_width_port_raises_while_an_unassigned_one_resolves(self) -> None:
"""The bounded fallback must not revert GitHub pull request #764.

``post_process`` is reachable directly -- not only through ``unpack``,
Expand Down
4 changes: 2 additions & 2 deletions tests/foundation/registry/test_protocols.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def test_register_protocol_stays_quiet_when_nothing_is_displaced(self) -> None:
"""A fresh key and an identical re-registration are both silent.

The code-keyed siblings share this identity guard too (#718) -- see
``test_sibling_registries_now_stay_quiet_on_an_identical_re_registration`` in
``test_sibling_registries_stay_quiet_on_an_identical_re_registration`` in
this file. Here the key is *derived* from the class rather than supplied by
the caller, and this function is the funnel every wrapper registrar ends in,
so registering one class under two codes -- supported, and exactly what
Expand Down Expand Up @@ -232,7 +232,7 @@ def test_register_protocol_stays_quiet_when_nothing_is_displaced(self) -> None:
self.assertIs(udp_registry[udp_port], UnitProtocol)
self.assertEqual(self._registry_warnings(caught, RegistryWarning), [])

def test_sibling_registries_now_stay_quiet_on_an_identical_re_registration(self) -> None:
def test_sibling_registries_stay_quiet_on_an_identical_re_registration(self) -> None:
"""GitHub issue #718: the siblings share ``register_protocol``'s guard.

A repeat registration naming the exact same class stays silent, exactly
Expand Down
2 changes: 1 addition & 1 deletion tests/project/test_changelog_md.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ def test_a_sub_heading_underline_joined_into_the_prose_is_fatal(self) -> None:
self._reject('\nA sub heading\n^^^^^^^^^^^^^\n\nSome prose.\n',
'setext underline joined')

def test_the_two_new_sub_heading_levels_become_atx_headings(self) -> None:
def test_dash_and_tilde_sub_headings_become_atx_headings(self) -> None:
# The other half: ``-`` and ``~`` *convert* rather than being rejected, one
# ATX level deeper each, so that the by-module sections and their
# Added/Changed/Fixed subsections survive into ``CHANGELOG.md``. Against a
Expand Down
20 changes: 10 additions & 10 deletions tests/project/test_conventions_doc_claims.py
Original file line number Diff line number Diff line change
Expand Up @@ -786,15 +786,15 @@ def test_a_delegating_override_is_a_classmethod(self) -> 'None':
# so it is a live failure mode rather than a hypothetical one. The KeyError
# fails the test either way, so nothing regressed silently; what it does not do
# is say *which* class stopped defining `get`, or that the page is then wrong to
# list it. The sibling at `test_the_two_redundant_overrides_are_gone` already
# list it. The sibling at `test_the_mh_helpers_define_no_get_override` already
# does this the right way round, with `assertNotIn('get', vars(klass))`.
# Deliberately *not* under `subTest`: a subTest records its failure and lets
# the method run on, so the bare `KeyError` this guard exists to pre-empt
# would still be raised by the indexing below and reported alongside it. A
# plain assertion aborts here, which is the whole point.
for klass in (Method, Command, OptionType):
self.assertIn('get', vars(klass),
f'{klass.__name__} no longer defines a get of its own, so '
f'{klass.__name__} defines no get of its own, so '
'the page is wrong to name it among the overrides -- an '
'override folded into the inherited base is what #940 did '
'to the mh/ngap helpers')
Expand All @@ -809,8 +809,8 @@ def test_a_delegating_override_is_a_classmethod(self) -> 'None':
'followed it')
self.assertIn('return super().get(key)',
inspect.getsource(vars(klass)['get'].__func__),
f'{klass.__name__}.get no longer delegates, so the page is '
'wrong to give it as a delegating override')
f'{klass.__name__}.get does not delegate to super().get(key), '
'so the page is wrong to give it as a delegating override')
self.assertIsInstance(vars(OptionType)['get'], staticmethod)
self.assertNotIn('super()', inspect.getsource(vars(OptionType)['get'].__func__),
'OptionType.get delegates to super(), so the page is wrong to list it '
Expand Down Expand Up @@ -948,7 +948,7 @@ def _restore() -> 'None':
'the page no longer states the ruling as its headline, so a '
'later mention of quiet=True is doing the work of pinning it')

def test_the_two_redundant_overrides_are_gone(self) -> 'None':
def test_the_mh_helpers_define_no_get_override(self) -> 'None':
"""#940: the owner ruled for deleting the redundant overrides, not widening them.

Several things at once, because the ruling is only settled if they all hold:
Expand Down Expand Up @@ -1200,14 +1200,14 @@ def test_the_extras_reader_agrees_with_tomllib(self) -> 'None':
'requirement string and a comment containing "]" are the two '
'shapes that broke it before')

def test_the_all_extra_is_exactly_the_three_core_addon_extras(self) -> 'None':
def test_the_all_extra_is_exactly_the_core_addon_extras(self) -> 'None':
"""``all`` carries core addons only, and the page's listing says what it is.

Two halves, because either can rot without the other. The tree half asks
:file:`pyproject.toml` whether ``all`` is still the union of ``cli``,
:file:`pyproject.toml` whether ``all`` is the union of ``cli``,
``crypto`` and ``NGAP`` and nothing else -- the shape GitHub issue #910's
ruling produced, narrowed to the core addons. The page half asks whether
the ``toml`` block on the page still shows that same list, since a page that
the ``toml`` block on the page shows that same list, since a page that
prints a stale ``all =`` line is worse than one that prints none.

"""
Expand All @@ -1216,14 +1216,14 @@ def test_the_all_extra_is_exactly_the_three_core_addon_extras(self) -> 'None':
core = [requirement for extra in ('cli', 'crypto', 'NGAP')
for requirement in extras[extra]]
self.assertEqual(sorted(extras['all']), sorted(core),
f"all is {extras['all']!r}, which is no longer the union of "
f"all is {extras['all']!r}, which is not the union of "
f'cli/crypto/NGAP {core!r} -- #910 narrowed it to the core '
'addons, so a change here is a change to that ruling')

# The page prints the literal list, so the literal list is what is checked.
listing = 'all = [ ' + ', '.join(f'"{req}"' for req in extras['all']) + ' ]'
self.assertIn(listing, _page(self.ANCHOR),
f'process.rst no longer shows {listing!r}; its toml block has '
f'process.rst does not show {listing!r}; its toml block has '
"drifted from pyproject.toml's own all extra")

def test_the_page_keeps_the_engine_and_installability_exclusions_apart(self) -> 'None':
Expand Down
2 changes: 1 addition & 1 deletion tests/project/test_docs_internal_refs_1940_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def test_documented_functions_have_docstrings(self) -> 'None':
class ConvertedReferenceTests(unittest.TestCase):
"""Each curated reference is a role, not a literal."""

def test_literal_is_now_a_role(self) -> 'None':
def test_each_curated_reference_is_a_role_not_a_literal(self) -> 'None':
for source, literal, role in CONVERTED:
with self.subTest(source=source, literal=literal):
text = (ROOT / source).read_text(encoding='utf-8')
Expand Down
2 changes: 1 addition & 1 deletion tests/project/test_unit_tests_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def test_the_step_runs_the_script_in_a_checkout(self) -> None:
class TestJobGating(unittest.TestCase):
"""Which jobs run on which events, read off their job-level keys."""

def test_the_four_legs_skip_only_on_a_docs_only_diff(self) -> None:
def test_each_leg_skips_only_on_a_docs_only_diff(self) -> None:
"""Each leg is gated on ``changes`` by a job-level ``if:``."""
for name in LEGS:
with self.subTest(job=name):
Expand Down
2 changes: 1 addition & 1 deletion tests/project/test_workflow_run_verdict.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ def test_a_skipped_head_cannot_cascade_into_the_acting_job(self) -> None:
self.assertTrue(condition.startswith('!cancelled() && '))
self.assertTrue(evaluate_condition(condition, skipped))

def test_the_three_call_one_head(self) -> None:
def test_every_acting_workflow_calls_one_head(self) -> None:
"""#1967: one copy of the gate and the verdict, called the same way from each.

The ``head`` jobs differ in their ``name:`` alone, no acting workflow
Expand Down
Loading