tests: Make sure testprocess raises if start fails.
This commit is contained in:
parent
b2dbd8baef
commit
dd211adf0f
@ -81,6 +81,14 @@ def pyproc():
|
||||
proc.terminate()
|
||||
|
||||
|
||||
def test_wait_signal_raising(qtbot):
|
||||
"""testprocess._wait_signal should raise by default."""
|
||||
proc = testprocess.Process()
|
||||
with pytest.raises(qtbot.SignalTimeoutError):
|
||||
with proc._wait_signal(proc.proc.started, timeout=0):
|
||||
pass
|
||||
|
||||
|
||||
class TestWaitFor:
|
||||
|
||||
def test_successful(self, pyproc):
|
||||
|
@ -172,7 +172,7 @@ class Process(QObject):
|
||||
self.read_log()
|
||||
return self._data
|
||||
|
||||
def _wait_signal(self, signal, timeout=5000, raising=None):
|
||||
def _wait_signal(self, signal, timeout=5000, raising=True):
|
||||
"""Wait for a signal to be emitted.
|
||||
|
||||
Should be used in a contextmanager.
|
||||
|
Loading…
Reference in New Issue
Block a user