needs_strict_codec now exists twice in the test tree: the shared copy in tests/conftest.py and a local one in tests/test_verify.py.
State
The marker skips a test when the host codec can decode byte 0xff — every ISO-8859-x and cp125x codec maps all 256 byte values, so under such a locale a strict-decode test goes vacuously green rather than exercising the fault it is named for.
The two are byte-identical in condition and skip reason.
Why the duplication was left in place
test_verify.py is otherwise untouched by the #380/#383 fix. De-duplicating it would have dragged a large, unrelated file into a bundled fix whose whole discipline was to claim exactly what it fixed and no more. Deliberate, and named in that PR's "Out of scope" section — filed here so it does not simply rot.
Asked for
Delete the local copy and its _codec_rejects_bad_byte helper from tests/test_verify.py; import the shared one from conftest, as the other three files do.
Worth carrying over rather than dropping: the comment above the local copy (tests/test_verify.py:56-58) records that CI is always on the exercising side of this skip — the Linux legs run UTF-8 and the Windows legs set PYTHONUTF8=1 (.github/workflows/ci.yml). That fact belongs with the shared definition, which currently does not state it.
Verification
Mechanical, but confirm the tests still run rather than newly skipping — a marker refactor that silently flips three tests to skipped is indistinguishable from green. -rs on the affected file, or an explicit assertion on the collected outcome, is enough.
needs_strict_codecnow exists twice in the test tree: the shared copy intests/conftest.pyand a local one intests/test_verify.py.State
The marker skips a test when the host codec can decode byte
0xff— every ISO-8859-x and cp125x codec maps all 256 byte values, so under such a locale a strict-decode test goes vacuously green rather than exercising the fault it is named for.tests/conftest.py:65— the shared copy, added by the Codec except-tuple asymmetry in _append_diag_jsonl (and POSIX-only strictness in tmux_base) #380/plugins/bus.py _run_subprocess decodes hook output strictly; a non-UTF-8 byte escapes _HookError and crashes the run #383 bundle so phase 2's tests could import it. Used bytests/test_multiplexer.py,tests/test_hook_bus.pyandtests/test_probe.py.tests/test_verify.py:59— a local copy predating it, with its own_codec_rejects_bad_bytehelper. Used at:296,:1090and:1114.The two are byte-identical in condition and skip reason.
Why the duplication was left in place
test_verify.pyis otherwise untouched by the #380/#383 fix. De-duplicating it would have dragged a large, unrelated file into a bundled fix whose whole discipline was to claim exactly what it fixed and no more. Deliberate, and named in that PR's "Out of scope" section — filed here so it does not simply rot.Asked for
Delete the local copy and its
_codec_rejects_bad_bytehelper fromtests/test_verify.py; import the shared one fromconftest, as the other three files do.Worth carrying over rather than dropping: the comment above the local copy (
tests/test_verify.py:56-58) records that CI is always on the exercising side of this skip — the Linux legs run UTF-8 and the Windows legs setPYTHONUTF8=1(.github/workflows/ci.yml). That fact belongs with the shared definition, which currently does not state it.Verification
Mechanical, but confirm the tests still run rather than newly skipping — a marker refactor that silently flips three tests to skipped is indistinguishable from green.
-rson the affected file, or an explicit assertion on the collected outcome, is enough.