mirror of
https://github.com/wiltodelta/remove-ai-watermarks.git
synced 2026-08-31 09:40:38 +02:00
34 lines
818 B
Python
34 lines
818 B
Python
"""Basic command-line contracts for standalone maintainer scripts."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import subprocess
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
"script",
|
|
[
|
|
"visible_groundtruth.py",
|
|
"visible_recall_sample.py",
|
|
"visible_sheets.py",
|
|
"registered_mark_calibrate.py",
|
|
],
|
|
)
|
|
def test_script_help_exits_cleanly(script: str) -> None:
|
|
result = subprocess.run( # noqa: S603 -- fixed interpreter and repository-owned script path
|
|
[sys.executable, str(ROOT / "scripts" / script), "--help"],
|
|
cwd=ROOT,
|
|
capture_output=True,
|
|
text=True,
|
|
check=False,
|
|
)
|
|
|
|
assert result.returncode == 0, result.stderr
|
|
assert "usage:" in result.stdout
|