weka / easypy

This repository will no longer be maintained. See instead https://github.com/real-easypy/easypy
BSD 3-Clause "New" or "Revised" License
14 stars 0 forks source link

Add decorator versions of the various wait functions #224

Open idanarye opened 4 years ago

idanarye commented 4 years ago

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):
    ...