Update to pytest-qt 2.1.0

This commit is contained in:
Florian Bruhin 2016-10-26 07:42:41 +02:00
parent bd414c5f01
commit ece3f3a2e1
8 changed files with 18 additions and 16 deletions

View File

@ -23,7 +23,7 @@ pytest-cov==2.4.0
pytest-faulthandler==1.3.0
pytest-instafail==0.3.0
pytest-mock==1.2
pytest-qt==2.0.0
pytest-qt==2.1.0
pytest-repeat==0.4.1
pytest-rerunfailures==2.0.1
pytest-travis-fold==1.2.0

View File

@ -152,7 +152,7 @@ def test_process_never_started(qtbot, quit_pyproc):
def test_wait_signal_raising(qtbot):
"""testprocess._wait_signal should raise by default."""
proc = testprocess.Process()
with pytest.raises(qtbot.SignalTimeoutError):
with pytest.raises(qtbot.TimeoutError):
with proc._wait_signal(proc.proc.started, timeout=0):
pass

View File

@ -131,8 +131,8 @@ def fake_statusbar(qtbot):
statusbar.container = container
vbox.addWidget(statusbar)
container.show()
qtbot.waitForWindowShown(container)
with qtbot.waitExposed(container):
container.show()
return statusbar

View File

@ -121,5 +121,5 @@ def test_tab(qtbot, view, config_stub, tab_registry, mode_manager):
assert tab_w.history._history is view.history()
assert view.parent() is tab_w
tab_w.show()
qtbot.waitForWindowShown(tab_w)
with qtbot.waitExposed(tab_w):
tab_w.show()

View File

@ -50,8 +50,9 @@ def test_elided_text(fake_statusbar, qtbot, elidemode, check):
long_string = 'Hello world! ' * 100
label.setText(long_string)
label.show()
qtbot.waitForWindowShown(label)
with qtbot.waitExposed(label):
label.show()
assert check(label._elided_text)
@ -74,8 +75,8 @@ def test_resize(qtbot):
long_string = 'Hello world! ' * 20
label.setText(long_string)
label.show()
qtbot.waitForWindowShown(label)
with qtbot.waitExposed(label):
label.show()
text_1 = label._elided_text
label.resize(20, 50)

View File

@ -55,8 +55,8 @@ def view(qtbot, config_stub):
usertypes.MessageLevel.warning,
usertypes.MessageLevel.error])
def test_single_message(qtbot, view, level):
view.show_message(level, 'test')
qtbot.waitForWindowShown(view)
with qtbot.waitExposed(view):
view.show_message(level, 'test')
assert view._messages[0].isVisible()

View File

@ -72,5 +72,6 @@ class TestTabWidget:
icon = QIcon(pixmap)
tab = fake_web_tab()
widget.addTab(tab, icon, 'foobar')
widget.show()
qtbot.waitForWindowShown(widget)
with qtbot.waitExposed(widget):
widget.show()

View File

@ -63,8 +63,8 @@ def keyhint(qtbot, config_stub, key_config_stub):
def test_show_and_hide(qtbot, keyhint):
with qtbot.waitSignal(keyhint.update_geometry):
keyhint.show()
qtbot.waitForWindowShown(keyhint)
with qtbot.waitExposed(keyhint):
keyhint.show()
keyhint.update_keyhint('normal', '')
assert not keyhint.isVisible()