Coverage for tests/test_xpass_friends.py: 100%
13 statements
« prev ^ index » next coverage.py v7.3.2, created at 2023-11-24 18:46 +0100
« prev ^ index » next coverage.py v7.3.2, created at 2023-11-24 18:46 +0100
1"""This test needs `download-more-tests.sh`.
3This is useful to avoid a sphinx-lint release to break many CIs.
4"""
6import shlex
7from pathlib import Path
9import pytest
11from sphinxlint.cli import main
13FIXTURE_DIR = Path(__file__).resolve().parent / "fixtures"
16@pytest.mark.parametrize(
17 "file",
18 [str(f) for f in (FIXTURE_DIR / "friends").iterdir() if f.name != ".DS_Store"]
19 if (FIXTURE_DIR / "friends").is_dir()
20 else [],
21)
22def test_sphinxlint_friend_projects_shall_pass(file, capsys):
23 flags = (Path(file) / "flags").read_text(encoding="UTF-8")
24 has_errors = main(["sphinxlint.py", file] + shlex.split(flags))
25 out, err = capsys.readouterr()
26 assert err == ""
27 assert out == "No problems found.\n"
28 assert not has_errors