mirror of
https://github.com/wiltodelta/remove-ai-watermarks.git
synced 2026-08-31 09:40:38 +02:00
Keep maintainer help portable on Windows
This commit is contained in:
@@ -4,6 +4,7 @@ from __future__ import annotations
|
||||
|
||||
import subprocess
|
||||
import sys
|
||||
from os import environ
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
@@ -31,3 +32,19 @@ def test_script_help_exits_cleanly(script: str) -> None:
|
||||
|
||||
assert result.returncode == 0, result.stderr
|
||||
assert "usage:" in result.stdout
|
||||
|
||||
|
||||
def test_visible_groundtruth_help_is_cp1252_safe() -> None:
|
||||
env = environ.copy()
|
||||
env["PYTHONIOENCODING"] = "cp1252"
|
||||
result = subprocess.run( # noqa: S603 -- fixed interpreter and repository-owned script path
|
||||
[sys.executable, str(ROOT / "scripts" / "visible_groundtruth.py"), "--help"],
|
||||
cwd=ROOT,
|
||||
env=env,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
check=False,
|
||||
)
|
||||
|
||||
assert result.returncode == 0, result.stderr
|
||||
assert "usage:" in result.stdout
|
||||
|
||||
Reference in New Issue
Block a user