Repository navigation
I'm using pytest-factoryboy and the factory boy fixture can't be found after updating pytest to 6.1.1.
File File File On OSX, using pytest 6.1.1, works: On Linux, the same fails: If I downgrade pytest to 6.1.0, it works: |
Replies: 10 comments
|
Works fine for me: Can you maybe share a built docker image where this can be reproduced? |
|
Thanks for he quick feedback. When creating a docker image with the following I pinned the issue to the The error In this example, those files were generated on my mac, so I understand I should have cleaned that directory. In my original problem, the tests are always run inside the docker container, but I mount the app directory as a volume. I found some pyc files generated: Moving the |
|
I saved the old |
|
After checking I saw that VS Code is creating that file when discovering the tests. So I guess that's what happened. You can close this issue. Sorry for the noise. |
|
Hmm, I still wonder how this can happen though! By any chance, can you reproduce when you run |
|
If I run If you pull this image, you can reproduce the problem. Running |
|
To summarise, it seems the full path of the files is used inside the Same issue with pytest 5 but not with pytest-4.6.11: |
|
I'm not really familiar with how pytest generates/reads .pyc files as part of its assertion rewriting - maybe someone else can look into this? |
|
We check for the This is not pytest specific, Python stores full paths inside I'm not sure there's anything to be done by pytest here. Perhaps we can edit the title and turn this into a discussion for others to find in the future? |
|
I agree. I don't think pytest should try to handle this. It's fine to close this issue. It's more something to be aware. |
To summarise, it seems the full path of the files is used inside the
pycfiles instead of relative path. This isn't a platform issue. It can easily be reproduced using docker by mounting the same directory in 2 different locations: