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

Normalise path before comparing on windows #225

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

patstew
Copy link

@patstew patstew commented Oct 2, 2019

Without this change I get pytest errors on MSYS2 like this:

=================================== ERRORS ====================================
_______________ ERROR collecting test_x.py ________________
import file mismatch:
imported module 'f.test_x' has this __file__ attribute:
  C:/path/to\f\test_x.py
which is not the same as the test file we want to collect:
  C:/path/to/f/test_x.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!
=========================== 1 error in 0.20 seconds ===========================

Removing __pycache__ or using PYTHONDONTWRITEBYTECODE=1 doesn't help.
This seems to be the same problem as #58 was trying to fix. I've moved it to __eq__ as suggested in the original PR on bitbucket.

@patstew
Copy link
Author

patstew commented Oct 2, 2019

I don't think that test failure is due to this PR

@blueyed
Copy link
Contributor

blueyed commented Mar 31, 2020

@patstew
Can you add a test for it, please? (and rebase it then)
Likely good to use the example from how pytest triggers it.

@bluetech
Copy link
Member

Note: this semantically conflicts with #243. If #243 is merged, then this PR will need to also update __hash__.

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.

None yet

3 participants