"""Bounded event-loop waits for recording review tests.""" import time from PySide6.QtCore import QCoreApplication def wait_review(widget): deadline = time.monotonic() + 10 while widget._job is not None and time.monotonic() < deadline: QCoreApplication.processEvents() # Release the GIL so the Python recording worker can finish its I/O. time.sleep(.001) assert widget._job is None, "background review did not finish"