Skip to content

Getting ImportMismatchErrors in combination with Jenkins #172

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

Closed
pytoxbot opened this issue Sep 17, 2016 · 6 comments
Closed

Getting ImportMismatchErrors in combination with Jenkins #172

pytoxbot opened this issue Sep 17, 2016 · 6 comments

Comments

@pytoxbot
Copy link

Not sure what the problem is. Tox works fine locally but we've hit a few problems recently.

A sample TB can be found here http://build.adimian.com/job/openpyxl-2.0/26/console

But the key line is:

#!python

E               ImportMismatchError: ('openpyxl.conftest', '/var/lib/jenkins/workspace/openpyxl-2.0/openpyxl/conftest.py', local('/var/lib/jenkins/workspace/openpyxl-2.0/.tox/py34/lib64/python3.4/site-packages/openpyxl/conftest.py'))

Looking at the source this relates to problems with file but what problems? Should the two files be the same?

@pytoxbot
Copy link
Author

Original comment by @Themanwithoutaplan

norecursedirs was missing for .tox

@pytoxbot
Copy link
Author

Original comment by @Themanwithoutaplan

Thanks very much Holger!

@pytoxbot
Copy link
Author

Original comment by @ericgazoni

Yup, did the trick, I'll add the norecursedirs for .tox to the configuration in the repository. Tests are starting slightly faster as well (I guess for not trying to recurse in the .tox directory)

@pytoxbot
Copy link
Author

Original comment by @ericgazoni

The file as it is on the server: pytest.ini

This is what jenkins does to run tox:

#!shell
find openpyxl -name *.pyc -delete
virtualenv .ve
source .ve/bin/activate

pip install tox 
tox

Shall I add a new option to norecursedirs mentioning .tox ?

@pytoxbot
Copy link
Author

Original comment by @Themanwithoutaplan

@ericgazoni you've got access to the box.

@hpk thanks for the fast answer! We're now using pytest for everything in the project.

#!ini

[pytest]
addopts = -l --strict
norecursedirs = lib include openpyxl/Issues

markers =
    pil_required: PIL required to run test
    pil_not_installed: Run test only if PIL is not installed
    not_py33: Do not run test on Python 3.
    lxml_required: lxml required to run test

@pytoxbot
Copy link
Author

Original comment by @hpk42

Not sure but Looks like you are collecting tests inside the .tox directory. Do you have any configuration of "norecursedirs" or something else that would py.test dive into your .tox directory?

@tox-dev tox-dev locked and limited conversation to collaborators Jan 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant