diff --git a/tests/integration/test_testprocess.py b/tests/integration/test_testprocess.py index 5b8b50db9..830f0ff41 100644 --- a/tests/integration/test_testprocess.py +++ b/tests/integration/test_testprocess.py @@ -136,6 +136,14 @@ class TestWaitFor: with pytest.raises(testprocess.WaitForTimeout): pyproc.wait_for(data="foobar", timeout=100) + def test_no_kwargs(self, pyproc): + """Using wait_for without kwargs should raise an exception. + + Otherwise it'd match automatically because of the all(matches). + """ + with pytest.raises(TypeError): + pyproc.wait_for() + class TestEnsureNotLogged: diff --git a/tests/integration/testprocess.py b/tests/integration/testprocess.py index 927782088..9a2c4134d 100644 --- a/tests/integration/testprocess.py +++ b/tests/integration/testprocess.py @@ -254,6 +254,8 @@ class Process(QObject): timeout = 15000 else: timeout = 5000 + if not kwargs: + raise TypeError("No keyword arguments given!") for key in kwargs: assert key in self.KEYS