Skip to content

Conversation

@missytake
Copy link
Contributor

This commit also makes testing hooks easier, as it allows to process events and run hooks on them, until a certain event occurs.

This commit also makes testing hooks easier, as it allows to process events and
run hooks on them, until a certain event occurs.
until_func: Callable[[AttrDict], bool],
until_event: EventType = False,
) -> AttrDict:
"""Process events until the given callable evaluates to True.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation needs to be updated

self._process_messages()

stop = func(event)
if event.kind == until_event:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe do this check after calling until_func? Calling it one more time may be useful, e.g. for logging purposes, and it even goes before until_event in the _process_events() parameter list

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants