Skip to content

The repository-docs checks format paths with the platform separator, so their own tests fail on Windows #429

Backlog

Description

@Luckyou-d

Problem

tests/test_repository_docs.py is red on Windows (8 of 29), because the checkers build their messages from a Path while their own assertions match repository-style paths:

E  AssertionError: Regex pattern did not match.
E    Expected regex: 'examples/demo/guide\.md'
E    Actual message: 'examples\demo\guide.md: missing leading knowledge metadata with last_checked'

Two places do it:

  • check_document_reviews -> path = document.relative_to(root) (line ~38) and uses it in every message
  • check_document_links -> f"Broken link: {document.relative_to(root)}:{number}: {destination}" (line ~234)

On POSIX the two render identically, which is why CI does not see it.

Expected

The message reads as a repository path on every platform, so pytest tests/test_repository_docs.py is green on Windows as it is on Linux - a contributor running the suite there should not have to wonder whether the failure is theirs.

Fix

.as_posix() on the two relative paths. PR to follow.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions