Skip to content

Commit ed91ae0

Browse files
authored
Add test for hints.md (laike9m#103)
1 parent 90c8078 commit ed91ae0

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

tests/conftest.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
CHALLENGES_DIR = Path(__file__).parent.parent / "challenges"
1515
ALL_QUESTIONS = list(CHALLENGES_DIR.glob("**/question.py"))
1616
ALL_SOLUTIONS = list(CHALLENGES_DIR.glob("**/solution*.py"))
17+
ALL_HINTS = list(CHALLENGES_DIR.glob("**/hints.md"))
1718

1819

1920
@pytest.fixture()
@@ -35,3 +36,8 @@ def question_file(request):
3536
@pytest.fixture(params=ALL_SOLUTIONS, ids=lambda x: x.parent.name)
3637
def solution_file(request):
3738
return request.param
39+
40+
41+
@pytest.fixture(params=ALL_HINTS, ids=lambda x: x.parent.name)
42+
def hint_file(request) -> Path:
43+
return request.param

tests/test_hints.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import re
2+
from pathlib import Path
3+
4+
5+
def test_link(hint_file: Path):
6+
# Verify if python docs url link to English documentation
7+
matches = re.findall(
8+
r"https://docs.python.org/[a-zA-Z]+-?[a-zA-Z]+",
9+
hint_file.read_text(encoding="utf-8"),
10+
)
11+
assert len(matches) == 0

0 commit comments

Comments
 (0)