original_docstring: Close a window/popup and run the event loop to make sure the closing
      complete.
  
      
docstring: Close a window/popup and run the event loop to make sure the closing
  complete.
docstring_tokens: Close a window / popup and run the event loop to make sure the closing complete .
code: def close_window_or_popup(qtbot, window_or_popup):
      """Close a window/popup and run the event loop to make sure the closing
      complete.
  
      """
      if window_or_popup.is_destroyed:
          return
      obs = EventObserver()
      window_or_popup.observe('destroyed', obs.callback)
      window_or_popup.close()
      qtbot.wait_until(obs.assert_called)
code_tokens: def close_window_or_popup ( qtbot , window_or_popup ) : if window_or_popup . is_destroyed : return obs = EventObserver ( ) window_or_popup . observe ( 'destroyed' , obs . callback ) window_or_popup . close ( ) qtbot . wait_until ( obs . assert_called )
short_docstring: Close a window/popup and run the event loop to make sure the closing
  complete.
short_docstring_tokens: Close a window / popup and run the event loop to make sure the closing complete .
comment: """Close a window/popup and run the event loop to make sure the closing
      complete.
  
      """