标签: python unit-testing python-decorators
我有这个功能我想测试:
@retry(delay = 2) def func1(): do_something_that_might_fail()
当我测试这个函数并模拟do_something_that_might_fail的失败时,装饰者等待两秒然后再次尝试。有没有办法覆盖装饰器的delay参数以使我的测试更快?
do_something_that_might_fail
delay