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

Tests fail with "import file mismatch" #1117

Closed
lfam opened this issue Feb 19, 2019 · 5 comments
Closed

Tests fail with "import file mismatch" #1117

lfam opened this issue Feb 19, 2019 · 5 comments

Comments

@lfam
Copy link

lfam commented Feb 19, 2019

While working on a distro package for GNU Guix I found that Autobahn's tests fail to run.

For example:

______ ERROR collecting build/lib/autobahn/nvx/test/test_utf8validator.py ______
import file mismatch:
imported module 'test_utf8validator' has this __file__ attribute:
  /tmp/guix-build-python-autobahn-19.2.1.drv-0/autobahn-19.2.1/autobahn/nvx/test/test_utf8validator.py
which is not the same as the test file we want to collect:
  /tmp/guix-build-python-autobahn-19.2.1.drv-0/autobahn-19.2.1/build/lib/autobahn/nvx/test/test_utf8validator.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules

This is with Python 3.7.0, mock 2.0.0, and pytest 3.8.0.

As a reminder, your setup.py specifies an older pytest in order to keep support for Python 3.3, but I "relaxed" that version requirement since we don't aim to support that older Python.

So, my apologies if that is the cause of these test failures...

The packaging discussion is here: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=34515#95

@oberstet
Copy link
Contributor

oberstet commented Feb 19, 2019

I found that Autobahn's tests fail to run.

our tests run fine: https://travis-ci.org/crossbario/autobahn-python/builds/493230514

yeah, getting pytest to cooperate across all the different flavors/combinations of python version/run-time is tricky .. and yeah, there are version pins and hacks. if you can come up with a PR that makes building work for debian and runs green on our CI, cool!

@PureTryOut
Copy link

The tests fail for me too with the same problems, this is on Alpine Linux with pytest 6.1.2 and Python 3.8.6.

Did you have any luck with this @lfam?

@lfam
Copy link
Author

lfam commented Dec 4, 2020

Hi @PureTryOut ,

No, we didn't ever resolve the problem, so the Guix package still skips the test suite. In the Guix bug report (linked above), we suspected it was related to this issue in pytest itself:

pytest-dev/pytest#529

@travankor
Copy link

Also running into this issue.

@PureTryOut
Copy link

Just a reminder that this is still broken with Python 3.10 and pytest 7.1.3.

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

No branches or pull requests

4 participants