Skip to content
Roboto
Esc
↑↓navigate↵open⌘Jpreview
On this page

roboto.waiters

Module Contents

Condition

roboto.waiters.Condition#View Source

Interval

roboto.waiters.Interval#View Source

TimeoutError

exception roboto.waiters.TimeoutError(msg)#View Source

Bases: TimeoutError

A wait gave up before its condition was met.

Subclasses the built-in TimeoutError, so except TimeoutError catches it whether or not the caller imported this class.

Parameters

msg str

Attributes

TimeoutError.msg

msg str #

What was being waited for, and where it stood when the wait gave up.

wait_for()

roboto.waiters.wait_for(condition, args=None, timeout=60 * 5, interval=5, timeout_msg='wait_for timed out')#View Source

Wait for a condition to be truthy.

Parameters

condition Condition

The condition to wait for. This should be a callable that returns a boolean.

args Optional[collections.abc.Sequence[Any]]

The arguments to pass to the condition callable on each iteration.

timeout float

The maximum amount of time to wait for the condition to be truthy.

interval Interval

The amount of time to wait between iterations. This can be an integer or a callable. If it is a callable, it will be called with the iteration number and should return an integer.

timeout_msg str

The message to include in the TimeoutError if the timeout is reached.

Raises

If the timeout is reached before the condition is truthy.

Returns

None

None

Was this page helpful?