Skip to content

Commit 13fe74f

Browse files
Test repository Markdown links
1 parent b5fadb9 commit 13fe74f

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

‎tests/test_markdown_links.py‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env python3
2+
"""Smoke test for repository-relative Markdown links."""
3+
from __future__ import annotations
4+
5+
import subprocess
6+
import sys
7+
from pathlib import Path
8+
9+
ROOT = Path(__file__).resolve().parents[1]
10+
CHECKER = ROOT / "scripts" / "check_markdown_links.py"
11+
12+
13+
def main() -> int:
14+
result = subprocess.run(
15+
[sys.executable, str(CHECKER)],
16+
cwd=ROOT,
17+
text=True,
18+
capture_output=True,
19+
check=False,
20+
)
21+
if result.returncode != 0:
22+
raise AssertionError(f"Markdown link check failed:\n{result.stdout}\n{result.stderr}")
23+
print("Markdown link smoke test passed")
24+
return 0
25+
26+
27+
if __name__ == "__main__":
28+
raise SystemExit(main())

0 commit comments

Comments
 (0)