fix(ci): keep install-docs help cp1252-safe
This commit is contained in:
@@ -13,7 +13,7 @@ Markers:
|
||||
|
||||
Normalisation (per RESEARCH Pitfall #4):
|
||||
- rstrip trailing whitespace
|
||||
- normalise CRLF → LF
|
||||
- normalise CRLF -> LF
|
||||
- strip `$ ` and `>>> ` REPL/prompt prefixes
|
||||
- skip blank lines + lines that are only `#` comments
|
||||
|
||||
|
||||
@@ -21,6 +21,8 @@ the tests don't depend on the real repo state.
|
||||
from __future__ import annotations
|
||||
|
||||
import importlib.util
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
@@ -52,6 +54,19 @@ def _make_root(tmp_path: Path, *, docs: dict[str, str], script: str) -> Path:
|
||||
return tmp_path
|
||||
|
||||
|
||||
def test_help_is_safe_for_cp1252_consoles():
|
||||
env = os.environ.copy()
|
||||
env["PYTHONIOENCODING"] = "cp1252"
|
||||
result = subprocess.run(
|
||||
[sys.executable, str(SCRIPT_PATH), "--help"],
|
||||
check=False,
|
||||
capture_output=True,
|
||||
env=env,
|
||||
)
|
||||
|
||||
assert result.returncode == 0, result.stderr.decode("ascii", errors="replace")
|
||||
|
||||
|
||||
def test_clean_state_passes(validator_module, tmp_path, capsys):
|
||||
root = _make_root(
|
||||
tmp_path,
|
||||
|
||||
Reference in New Issue
Block a user