From 5ed4200e61f8ef5de173bce198322314e2a737ab Mon Sep 17 00:00:00 2001 From: Jean Michel Mugabe Date: Sun, 4 Oct 2026 15:12:12 -0400 Subject: [PATCH 1/3] docs: document waitUntil timeout parameter --- docs/wait_until.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/wait_until.rst b/docs/wait_until.rst index 6c1f3df3..67ff23c5 100644 --- a/docs/wait_until.rst +++ b/docs/wait_until.rst @@ -41,8 +41,10 @@ assertion: def check_label(): assert window.status.text() == "Please input a number" - qtbot.waitUntil(check_label) + qtbot.waitUntil(check_label, timeout=2000) +The optional ``timeout`` parameter specifies how long to wait, in milliseconds, +before raising a timeout error. ``qtbot.waitUntil`` will periodically call ``check_label`` until it no longer raises ``AssertionError`` or a timeout is reached. If a timeout is reached, a @@ -58,8 +60,8 @@ is raised from the last assertion error and the test will fail: E - OK E + Please input a number _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ - > qtbot.waitUntil(check_label) - E pytestqt.exceptions.TimeoutError: waitUntil timed out in 1000 milliseconds + > qtbot.waitUntil(check_label, timeout=2000) + E pytestqt.exceptions.TimeoutError: waitUntil timed out in 2000 milliseconds A second way to use ``qtbot.waitUntil`` is to pass a callback which returns ``True`` when the From 1d0a4abe6b5c7b56aaa4050b202f744dc48724aa Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Wed, 7 Oct 2026 15:12:33 -0300 Subject: [PATCH 2/3] Apply suggestion from @nicoddemus --- docs/wait_until.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/wait_until.rst b/docs/wait_until.rst index 67ff23c5..e88db849 100644 --- a/docs/wait_until.rst +++ b/docs/wait_until.rst @@ -44,7 +44,7 @@ assertion: qtbot.waitUntil(check_label, timeout=2000) The optional ``timeout`` parameter specifies how long to wait, in milliseconds, -before raising a timeout error. +before raising a timeout error (defaults to `5000`). ``qtbot.waitUntil`` will periodically call ``check_label`` until it no longer raises ``AssertionError`` or a timeout is reached. If a timeout is reached, a From 8421af7bd54a32f9afe09c0f6ebc99c4c3548823 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Wed, 7 Oct 2026 15:16:01 -0300 Subject: [PATCH 3/3] Update docs/wait_until.rst --- docs/wait_until.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/wait_until.rst b/docs/wait_until.rst index e88db849..01de9aa6 100644 --- a/docs/wait_until.rst +++ b/docs/wait_until.rst @@ -44,7 +44,7 @@ assertion: qtbot.waitUntil(check_label, timeout=2000) The optional ``timeout`` parameter specifies how long to wait, in milliseconds, -before raising a timeout error (defaults to `5000`). +before raising a timeout error (defaults to ``5000``). ``qtbot.waitUntil`` will periodically call ``check_label`` until it no longer raises ``AssertionError`` or a timeout is reached. If a timeout is reached, a