@contextmanager
def event_loop():

    app = get_app_qt4()

    yield

    app.sendPostedEvents()
    app.processEvents()
Post and process the Qt events at the exit of the code block.
dataset/ETHPy150Open enthought/pyface/pyface/ui/qt4/util/testing.py/event_loop