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
ImportPathMismatchError on WindowsPath #8076
Comments
On Windows, os.path.samefile returns false for paths mounted in UNC paths which point to the same location. I couldn't reproduce the actual case reported, but looking at the code it seems this commit should fix the issue. Fix pytest-dev#7678 Fix pytest-dev#8076
On Windows, os.path.samefile returns false for paths mounted in UNC paths which point to the same location. I couldn't reproduce the actual case reported, but looking at the code it seems this commit should fix the issue. Fix pytest-dev#7678 Fix pytest-dev#8076
Agreed these issues are very similar. It's not a UNC path, but it is a mounted path, so likely going through similar underlying APIs that may be failing on samefile. I'll try with your branch and see how it goes. |
I've confirmed the issue was still occurring on pytest stable, then remedied by using the candidate commit above. I was careful to run the tox tests twice in each configuration (because the issue only occurred on subsequent invocations) and clean between the two experiments. So I'm pleased to say this issue is a confirmed duplicate and the proposed fix works as intended. |
Awesome, thanks for testing it out @jaraco. 👍 |
I'm running pytest in a Windows 2019 Docker image on macOS 11 with the project under test mounted from the host file system at
C:\src
.When I run pytest under tox the first time, the tests run as expected.
When I run them a second time, pytest fails early with an ImportError:
It appears that pytest is somehow detecting that
C:\src\conftest.py
is not the same file asC:/src/conftest.py
. I'm not sure what library is generating the wrong slashes.Deleting the tox work dir at
C:\tox
and re-running tox allows the tests to run once again, so whatever is caching path with the funny slashes is caching it in the tox work dir.The text was updated successfully, but these errors were encountered: