Skip to content

Commit

Permalink
Fix rel path tests for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
gudzpoz committed Jan 17, 2025
1 parent fbbd767 commit 55f247c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/integration/test_translated_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,13 @@ def test_translated_cross_links(build, output_dir, other_locale):
href = link.get("href")
if text in expected:
link_count += 1
dest = os.path.join(os.path.dirname(f), href)
rel = os.path.relpath(dest, output_dir).strip('/')
dest = os.path.join(
output_dir if href.startswith("/") else os.path.dirname(f),
href,
)
rel = os.path.relpath(dest, output_dir).strip("/").replace("\\", "/")
assert rel == expected[text]
assert link_count == len(expected)
assert link_count == len(expected), (f, text, href)


@pytest.fixture(scope="module")
Expand Down

0 comments on commit 55f247c

Please sign in to comment.