From aac1fa371137f5a187ace13aa117087f350a34de Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 26 Oct 2016 12:34:04 +0200 Subject: [PATCH 1/4] Use QWidget in test_wait_window --- pytestqt/qt_compat.py | 2 -- tests/test_basics.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) 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..427a52bf 100644 --- a/tests/test_basics.py +++ b/tests/test_basics.py @@ -84,7 +84,7 @@ 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): From 9642109a5440b4c6cf9704fb56bf3720a3d368d7 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 26 Oct 2016 12:34:31 +0200 Subject: [PATCH 2/4] Simplify test_wait_window --- tests/test_basics.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/test_basics.py b/tests/test_basics.py index 427a52bf..ddf3f314 100644 --- a/tests/test_basics.py +++ b/tests/test_basics.py @@ -88,9 +88,6 @@ def test_wait_window(show, method_name, qtbot): 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') From 670ef471bd28c78b11d59f464b27105d3bdda85d Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 26 Oct 2016 12:34:40 +0200 Subject: [PATCH 3/4] Run test_wait_window on Travis again --- tests/test_basics.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/test_basics.py b/tests/test_basics.py index ddf3f314..835c2fab 100644 --- a/tests/test_basics.py +++ b/tests/test_basics.py @@ -89,8 +89,6 @@ def test_wait_window(show, method_name, qtbot): if show: with method(widget, timeout=1000): 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): From 14ecc79382b985131249eb38ee6ca6c2ae56992f Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 26 Oct 2016 12:46:57 +0200 Subject: [PATCH 4/4] Run herbstluftwm on Travis CI --- .travis.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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: