traits_futures.qt.gui_test_assistant module

Test support, providing the ability to run the event loop from tests.

class traits_futures.qt.gui_test_assistant.GuiTestAssistant[source]

Bases: object

run_until(object, trait, condition, timeout=10.0)[source]

Run event loop until the given condition holds true, or until timeout.

The condition is re-evaluated, with the object as argument, every time the trait changes.

Parameters
  • object (traits.has_traits.HasTraits) – Object whose trait we monitor.

  • trait (str) – Name of the trait to monitor for changes.

  • condition (callable) – Single-argument callable, returning a boolean. This will be called with object as the only input.

  • timeout (float, optional) – Number of seconds to allow before timing out with an exception. The (somewhat arbitrary) default is 10 seconds.

Raises

RuntimeError – If timeout is reached, regardless of whether the condition is true or not at that point.

setUp()[source]
tearDown()[source]
traits_futures.qt.gui_test_assistant.TIMEOUT = 10.0

Default timeout, in seconds