#NEWLINE# @ contextlib . contextmanager #NEWLINE# def event_loop_until_condition( self , condition , timeout = 10.0 ) : #NEWLINE# #INDENT# 'Runs the real Qt event loop until the provided condition evaluates\n        to True.\n\n        This should not be used to wait for widget deletion. Use\n        delete_widget() instead.\n\n        Parameters\n        ----------\n        condition : callable\n            A callable to determine if the stop criteria have been met. This\n            should accept no arguments.\n        timeout : float\n            Number of seconds to run the event loop in the case that the\n            condition is not satisfied.\n        ' #NEWLINE# try : #NEWLINE# #INDENT# ( yield ) #NEWLINE# self . event_loop_helper . event_loop_until_condition ( condition , timeout = timeout ) #NEWLINE# #UNINDENT# except ConditionTimeoutError : #NEWLINE# #INDENT# self . fail ( 'Timed out waiting for condition' )