Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pathlib: fix symlinked directories not followed during collection #7982

Merged
merged 1 commit into from
Oct 31, 2020

Conversation

bluetech
Copy link
Member

Fixes #7981.

@bluetech bluetech added the needs backport applied to PRs, indicates that it should be ported to the current bug-fix branch label Oct 31, 2020
@bluetech bluetech merged commit a14a229 into pytest-dev:master Oct 31, 2020
bluetech added a commit to bluetech/pytest that referenced this pull request Oct 31, 2020
pathlib: fix symlinked directories not followed during collection
(cherry picked from commit a14a229)
@bluetech bluetech mentioned this pull request Oct 31, 2020
bluetech added a commit to bluetech/pytest that referenced this pull request Oct 31, 2020
pathlib: fix symlinked directories not followed during collection
(cherry picked from commit a14a229)

Changed pytester -> testdir.
"""A symlinked directory is collected."""
dir = pytester.mkdir("dir")
dir.joinpath("test_it.py").write_text("def test_it(): pass", "utf-8")
pytester.path.joinpath("symlink_dir").symlink_to(dir)
Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, should have used symlink_or_skip here, and absent that, should have used symlink_to(dir, target_is_directory=True). I wonder how it passed windows CI without it. Will fix it anyway.

@bluetech bluetech deleted the symlink-collect branch November 6, 2020 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs backport applied to PRs, indicates that it should be ported to the current bug-fix branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Symlinked directories not collected since pytest 6.1.0
2 participants