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

Do not collect symlinked tests under Windows #12050

Merged
merged 7 commits into from
Mar 3, 2024

Conversation

mrbean-bremen
Copy link
Member

The check for short paths under Windows via os.path.samefile, introduced in #11936, also found similar tests in symlinked tests in the GH Actions CI. This checks additionally that one of the files is not a symlink.

Fixes #12039.

mrbean-bremen and others added 5 commits March 3, 2024 08:40
The check for short paths under Windows via os.path.samefile, introduced in pytest-dev#11936, also found similar tests in symlinked tests in the GH Actions CI.
This checks additionally that one of the files is not a symlink.

Fixes pytest-dev#12039.
@@ -1789,6 +1789,26 @@ def test_collect_short_file_windows(pytester: Pytester) -> None:
assert result.parseoutcomes() == {"passed": 1}


def test_not_collect_symlink_syblings(
pytester: Pytester, tmp_path: Path, request: pytest.FixtureRequest
Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks @nicoddemus, that's much better! Nitpicking: its "siblings", not "syblings".

Copy link
Member

Choose a reason for hiding this comment

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

Thanks!

@nicoddemus
Copy link
Member

Thanks @mrbean-bremen!

Tweaked things a bit to add more information (I also added a test similar to yours in a previous commit, because I saw the PR yesterday without a test, and went to work on a test right away this morning, not realizing you had pushed a new test since then 😅).

@mrbean-bremen
Copy link
Member Author

Yes, I added the test before making the PR - you have probably seen the branch before that. Anyway, your test is better, and the documentation is clearer :)

Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

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

Thanks again @mrbean-bremen!

@nicoddemus nicoddemus merged commit 8248946 into pytest-dev:main Mar 3, 2024
24 checks passed
@mrbean-bremen mrbean-bremen deleted the symlinked-tests branch March 3, 2024 12:41
flying-sheep pushed a commit to flying-sheep/pytest that referenced this pull request Apr 9, 2024
The check for short paths under Windows via os.path.samefile, introduced in pytest-dev#11936, also found similar tests in symlinked tests in the GH Actions CI.

Fixes pytest-dev#12039.

Co-authored-by: Bruno Oliveira <bruno@soliv.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pytest 8.0.2 may collect tests multiple times under Windows
2 participants