From 4452836d78777f3ab3f8a3e9da789607b30c880c Mon Sep 17 00:00:00 2001 From: Reuben Thomas Date: Sat, 23 Nov 2024 19:44:14 +0000 Subject: [PATCH] Tests: implement link checking of results --- tests/test_nancy.py | 2 +- tests/testutils.py | 8 ++------ tox.ini | 1 + 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/tests/test_nancy.py b/tests/test_nancy.py index ed228c3..d2e1c62 100644 --- a/tests/test_nancy.py +++ b/tests/test_nancy.py @@ -58,7 +58,7 @@ def test_part_tree() -> None: def test_two_trees() -> None: with chdir(tests_dir): passing_test(["mergetrees-src", "webpage-src"], "mergetrees-expected") - check_links("mergetrees-expected", "index.html") + check_links("mergetrees-expected", "index.html") def test_nested_macro_invocations() -> None: diff --git a/tests/testutils.py b/tests/testutils.py index 6b4a089..6d3ac10 100644 --- a/tests/testutils.py +++ b/tests/testutils.py @@ -8,6 +8,7 @@ import io import os import sys +import subprocess import re import filecmp import difflib @@ -141,9 +142,4 @@ def failing_cli_test( def check_links(root: str, start: str) -> None: - pass - # FIXME - # results = check({"path": start, "serverRoot": root}) - # if not results.passed: - # warn(results) - # assert results.passed == "Broken links in output" + subprocess.check_call(["linkchecker", os.path.join(root, start)]) diff --git a/tox.ini b/tox.ini index 356d244..a44b9fe 100644 --- a/tox.ini +++ b/tox.ini @@ -8,6 +8,7 @@ xfail_strict = True [testenv] deps = coverage + LinkChecker mypy pylint types-setuptools