Skip to content

Conversation

@bluetech
Copy link
Member

The previous check does not account for multiple levels of symlinks: given a -> b -> c, a would match b.

Note, I don't use Windows and can't actually verify it, I only saw it reading the code. But if it's wrong hopefully the existing test_do_not_collect_symlink_siblings test will catch it on Windows CI.

is_match = same_file and (
os.path.islink(node.path)
== os.path.islink(matchparts[0])
# account for short-paths on Windows (#11895). But use a version
Copy link
Member

Choose a reason for hiding this comment

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

Let's move the logic into a function in compat and add a unittests?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done! Since I don't run windows, going to rely on CI to see if it actually passes there.

Copy link
Member

Choose a reason for hiding this comment

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

Sorry about that, I run Windows but didn't have time to check this.

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Aug 10, 2025
The previous check does not account for multiple levels of symlinks:
given a -> b -> c, a would match b.
@bluetech
Copy link
Member Author

bluetech commented Sep 7, 2025

Merging, should be good.

@bluetech bluetech merged commit defc235 into pytest-dev:main Sep 7, 2025
35 checks passed
@bluetech bluetech deleted the win-is-match branch September 10, 2025 13:22
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.

3 participants