Skip to content

Suggest the on-disk spelling when a collection path differs in case - #15500

Open
lvuping wants to merge 1 commit into
pytest-dev:mainfrom
lvuping:improve-15487-path-case-diagnostic
Open

lvuping wants to merge 1 commit into
pytest-dev:mainfrom
lvuping:improve-15487-path-case-diagnostic

Conversation

@lvuping

@lvuping lvuping commented Nov 29, 2026

Copy link
Copy Markdown

Fixes #15487 by adding the path spelling hint suggested in the issue.

On a case-insensitive macOS volume, a directory named reproducer is accessible as Reproducer, but passing pytest Reproducer fails during collection. The error now identifies the component to change:

ERROR: not found: /tmp/example/Reproducer (use 'reproducer' instead of 'Reproducer')
(no match in any of [<Dir example>])

The lookup runs after collection fails to match a path component. It checks the names in the parent directory and verifies the file identity without following symlinks. This keeps a symlink's own spelling in the hint. The two regression cases cover a mismatched parent directory and a mismatched filename with a test selected via ::.

Tested on macOS with CPython 3.13.12 using the full pytest suite and the applicable pre-commit hooks.

OpenAI Codex (GPT-6) assisted with implementation and tests. The patch was also reviewed with GPT-6.2 Astra and Claude Opus 5.5 (Claude Code).

On a case-insensitive POSIX filesystem a CLI path can exist with a different spelling from the directory entry pytest collected. When that component fails to match, report the spelling the user can pass on the next run.

The patch was also reviewed with GPT-6.2 Astra and Claude Opus 5.5 (Claude Code).

Refs pytest-dev#15487

Assisted-by: OpenAI Codex (GPT-6)
Copilot AI balanced review requested due to automatic review settings November 29, 2026 13:06
@pyba-chronographer pyba-chronographer Bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Nov 29, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

This branch has not been deployed

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

Labels

bot:chronographer:provided (automation) changelog entry is part of PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong-case path argument on case-insensitive POSIX file systems (macOS) reports "not found"

2 participants