Skip to content
This repository was archived by the owner on Apr 22, 2020. It is now read-only.

Add decorator versions of the various wait functions #224

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

idanarye
Copy link

@idanarye idanarye commented Mar 4, 2020

I've noticed this common pattern:

def foo(self, a, b, c, timeout=60):
    def pred():
	...
    wait(timeout, pred, message=False)

These new decorators can be used to remove this boilerplate:

@waiting(timeout=60)
def foo(self, a, b, c):
    ...

@idanarye idanarye requested review from koreno and YuvalEvron March 4, 2020 13:20
Copy link
Contributor

@koreno koreno left a comment

Choose a reason for hiding this comment

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

seems like there's a stray print call.
also I think the __make_waiting_decorator and __waiting_decorator could use some high-level commenting so we can tell what the code intends to be doing.


def __make_waiting_decorator(wait_function):
def inner(decorator):
print('Decorating', decorator, 'as', wait_function)
Copy link
Contributor

Choose a reason for hiding this comment

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

print?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants