Set up a Q Application for QT with an X-Window Virtual Framebuffer (Xvfb).
Install using your favourite package installer:
pip install pytest-qt-app
# or
easy_install pytest-qt-app
Enable the fixture explicitly in your tests or conftest.py (not required when using setuptools entry points):
pytest_plugins = ['pytest_qt_app']
The fixtures are configured using the following evironment variables:
Setting | Description | Default |
---|---|---|
SERVER_FIXTURES_XVFB | Xvfb server executable | /usr/bin/Xvfb |
Here's a little test that shows it working:
from PyQt4 import Qtgui
def test_q_application(q_application):
# This shows the display is connected properly to the Xvfb
assert QtGui.QX11Info.display()