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

Windows symlink broken by Path().resolve() #5905

Closed
adamkerz opened this issue Oct 2, 2019 · 4 comments
Closed

Windows symlink broken by Path().resolve() #5905

adamkerz opened this issue Oct 2, 2019 · 4 comments
Labels
platform: windows windows platform-specific problem topic: collection related to the collection phase type: bug problem that needs to be addressed type: regression indicates a problem that was introduced in a release which was working previously

Comments

@adamkerz
Copy link

adamkerz commented Oct 2, 2019

On Windows 10 (v1903, 18362.356) I have created a D: drive using Subst. My tests used to work, but I recently upgraded pytest and found that I now get this error message for every test file:

____________________________________________ ERROR collecting test_feature_toggles.py _____________________________________________
import file mismatch:
imported module 'tests.unit.test_feature_toggles' has this __file__ attribute:
  D:\development\psma\api\api-master\api_services\pav\imp\src\tests\unit\test_feature_toggles.py
which is not the same as the test file we want to collect:
  C:\d_drive\development\psma\api\api-master\api_services\pav\imp\src\tests\unit\test_feature_toggles.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules

Well, they are the same file, deleting ALL pycache/.pyc files has no impact and I believe the problem was introduced in this PR:
#5564

I believe this may be the same cause of a different bug: #5826

Is it possible to use Path().absolute() instead?

Pytest version: 5.1.3

(.venv) D:\development\psma\api\api-master\api_services\pav\imp\src>pip list
Package             Version   Location
------------------- --------- ---------------------------------------------------------
aniso8601           8.0.0
apispec             0.39.0
argcomplete         1.9.3
atomicwrites        1.3.0
attrdict            2.0.1
attrs               19.1.0
Beaker              1.11.0
blinker             1.4
boto3               1.9.58
botocore            1.12.233
certifi             2019.9.11
cfn-flip            1.2.1
chardet             3.0.4
Click               7.0
colorama            0.4.1
common-utils        0.1       d:\development\psma\api\api-master\libraries\common_utils
config-load         0.1       d:\development\psma\api\api-master\libraries\config_load
coverage            4.5.4
docutils            0.15.2
durationpy          0.5
elasticsearch       2.4.0
factory-boy         2.12.0
Faker               2.0.2
flasgger            0.9.2
Flask               1.0.2
Flask-Cors          3.0.7
Flask-RESTful       0.3.6
Flask-SQLAlchemy    2.3.2
future              0.16.0
fuzzywuzzy          0.17.0
hjson               3.0.1
idna                2.8
importlib-metadata  0.23
itsdangerous        1.1.0
Jinja2              2.10.1
jmespath            0.9.4
json-logging        1.0.3
jsonschema          3.0.2
kappa               0.6.0
lambda-packages     0.20.0
MarkupSafe          1.1.1
marshmallow         2.16.3
mistune             0.8.4
mock                3.0.5
more-itertools      7.2.0
multi-key-dict      2.0.3
packaging           19.2
pav-data            0.0.1     d:\development\psma\api\api-master\data_services\pav_data
phonetics           1.0.5
pip                 19.2.3
placebo             0.9.0
pluggy              0.13.0
psycopg2-binary     2.7.6.1
py                  1.8.0
pynamodb            3.3.1
pyparsing           2.4.2
pyrsistent          0.15.4
pytest              5.1.3
pytest-cov          2.7.1
pytest-mock         1.10.4
python-crfsuite     0.9.6
python-dateutil     2.8.0
python-slugify      1.2.4
pytz                2019.2
PyYAML              5.1.2
requests            2.22.0
s3transfer          0.1.13
sentry-sdk          0.6.5
setuptools          28.8.0
six                 1.12.0
SQLAlchemy          1.2.14
text-unidecode      1.3
toml                0.10.0
tqdm                4.19.1
troposphere         2.5.1
Unidecode           1.1.1
urllib3             1.24.1
wcwidth             0.1.7
Werkzeug            0.16.0
wheel               0.33.6
wsgi-request-logger 0.4.6
zappa               0.48.2
zipp                0.6.0

To recreate, use subst to map a folder where you have tests into a new drive letter, cd to that folder on the new drive letter and try to run the tests again.

@Zac-HD Zac-HD added platform: windows windows platform-specific problem topic: collection related to the collection phase type: bug problem that needs to be addressed labels Oct 3, 2019
@adamkerz
Copy link
Author

Confirmed:
pytest==5.0.1 is fine
pytest==5.1.0 exhibits the bug. This is a regression.

@blueyed
Copy link
Contributor

blueyed commented Oct 31, 2019

Can you git-bisect it?

@blueyed blueyed added the type: regression indicates a problem that was introduced in a release which was working previously label Oct 31, 2019
@adamkerz
Copy link
Author

adamkerz commented Nov 6, 2019

Yes, I will try to get time to do that, blueyed.

@fabioz
Copy link
Contributor

fabioz commented Jan 24, 2020

This should be closed as a duplicate of #5965 (since that one has a pull request).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: windows windows platform-specific problem topic: collection related to the collection phase type: bug problem that needs to be addressed type: regression indicates a problem that was introduced in a release which was working previously
Projects
None yet
Development

No branches or pull requests

4 participants