diff --git a/.travis.yml b/.travis.yml index 1f3f68d2..526ddcc5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,8 +23,8 @@ env: install: - sudo apt-get update - # Xvfb - - sudo apt-get install -y xvfb + # Xvfb / window manager + - sudo apt-get install -y xvfb herbstluftwm # Qt - python scripts/install-qt.py @@ -38,10 +38,16 @@ install: # others - pip install coveralls --use-wheel +before_script: + - "export DISPLAY=:99.0" + - "sh -e /etc/init.d/xvfb start" + - sleep 3 # give xvfb some time to start + - "herbstluftwm &" + - sleep 1 + script: - python setup.py develop - # change screen size and depth in attempt to fix waitActive test (#160) - - catchsegv xvfb-run --server-args="-screen 0 640x480x24" coverage run --source=pytestqt setup.py test + - catchsegv coverage run --source=pytestqt setup.py test - tox -e lint after_success: diff --git a/pytestqt/qt_compat.py b/pytestqt/qt_compat.py index 3dd6b468..22f0bf88 100644 --- a/pytestqt/qt_compat.py +++ b/pytestqt/qt_compat.py @@ -106,7 +106,6 @@ def _import_module(module_name): self.Property = QtCore.Property self.QApplication = QtGui.QApplication self.QWidget = QtGui.QWidget - self.QLineEdit = QtGui.QLineEdit self.QStringListModel = QtGui.QStringListModel self.qInstallMsgHandler = QtCore.qInstallMsgHandler @@ -137,7 +136,6 @@ def make_variant(value=None): _QtWidgets = _import_module('QtWidgets') self.QApplication = _QtWidgets.QApplication self.QWidget = _QtWidgets.QWidget - self.QLineEdit = _QtWidgets.QLineEdit self.qInstallMessageHandler = QtCore.qInstallMessageHandler self.QStringListModel = QtCore.QStringListModel diff --git a/tests/test_basics.py b/tests/test_basics.py index 0464cb82..835c2fab 100644 --- a/tests/test_basics.py +++ b/tests/test_basics.py @@ -84,16 +84,11 @@ def test_wait_window(show, method_name, qtbot): pass assert str(exc_info.value) == 'Available in PyQt5 only' else: - widget = qt_api.QLineEdit() + widget = qt_api.QWidget() qtbot.add_widget(widget) if show: with method(widget, timeout=1000): - widget.move(100, 100) - widget.resize(100, 100) - widget.setFocus() widget.show() - if 'TRAVIS' in os.environ and method_name == 'waitActive': - pytest.xfail('skipping this check on travis, see #160') else: with pytest.raises(qtbot.TimeoutError): with method(widget, timeout=100):