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

Travis & pytest-qt #6

Closed
bh opened this issue May 14, 2014 · 7 comments
Closed

Travis & pytest-qt #6

bh opened this issue May 14, 2014 · 7 comments

Comments

@bh
Copy link
Member

bh commented May 14, 2014

Hi, I'm using pytest-qt (with PySide) on Travis. I got an error while running the GUI tests for the QT interface:

https://travis-ci.org/bh/python-keepass-httpd/jobs/24874738

Do you have an idea how to resolve this issue?

@nicoddemus
Copy link
Member

Hi Benjamin,

I had a lot of work in order to make pytest-qt's tests run on travis as well. 😃

The error you are having is that pytest-qt is unable to import PySide or PyQt4. I noticed you are already using apt-get in order to install python-pyside, the only problem is that apt-get installs those on the system and the virtual environment setup by travis does not include system libraries. I worked around that by manually creating a link from the system into the virtual environment (as you can see in the .travis.yaml file):

sudo apt-get install -qq python-pyside;
ln -s /usr/lib/python$TRAVIS_PYTHON_VERSION/dist-packages/PySide /home/travis/virtualenv/python$TRAVIS_PYTHON_VERSION/lib/python$TRAVIS_PYTHON_VERSION/site-packages -v;

With this pytest-qt should be able to import PySide. You can put this line after the link to ensure it imports correctly:

python -c "import PySide; print(PySide.__file__)"

I also reported issue #7 to provide a better error message.

Let me know how that goes.

Cheers

@bh
Copy link
Member Author

bh commented May 14, 2014

Ahhh ok, I thought that
bash $ tox --sitepackages
includes all packages which are installed on the system Python. Mhhhh...

@nicoddemus
Copy link
Member

I think the problem is that, at that point, tox is seeing only the "virtual env" python, which does not include the system libraries.

@bh
Copy link
Member Author

bh commented May 15, 2014

I had tried to add:

virtualenv:
  system_site_packages: true

to the travis.yml. It seems that this works. But I got an another error:
https://travis-ci.org/bh/python-keepass-httpd/jobs/25236654

Thank you.

@nicoddemus
Copy link
Member

Hi Benjamin,

I see you are using pytest-qt 1.0.2. Can you try against 1.1? I have some
changes to the packaging to make it more similar to other pytest plugins.

Cheers,

On Thu, May 15, 2014 at 9:01 AM, Benjamin Hedrich
notifications@github.comwrote:

I had tried to add:

virtualenv:
system_site_packages: true

to the travis.yml. It seems that this works. But I got an another error:
https://travis-ci.org/bh/python-keepass-httpd/jobs/25236654

Thank you.


Reply to this email directly or view it on GitHubhttps://github.com/nicoddemus/pytest-qt/issues/6#issuecomment-43200867
.

@bh
Copy link
Member Author

bh commented May 15, 2014

Excellent, that works:
https://travis-ci.org/bh/python-keepass-httpd/jobs/25237783

BTW: the new code in .travis.yml:

virtualenv:
  system_site_packages: true

works fine without symlinking. Try it!

Thank you! :-)

@nicoddemus
Copy link
Member

Created a new issue for it, will certainly try it! Cheers

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

2 participants