mardi 27 octobre 2015

Changing decorator params in unit tests [duplicate]

This question is an exact duplicate of:

I have this function I would like to test:

@retry(delay = 2)
def func1():
    do_something_that_might_fail()

When I test this func and mock a failure of do_something_that_might_fail the decorator waits for two seconds and then tries again. Is there a way to override the delay param of the decorator to make my test faster?

Aucun commentaire:

Enregistrer un commentaire