FakeLoopingCall raises IOError
All unittests using FakeLoopingCall raise an IOError if an initial delay is not specified, because the default initial_dealy is -1. Changing the default initial delay to 0. story: 2005112 task: 29748 Change-Id: I6cbae0996c2347e25d8be617e4b3fd93f4d9cc95
This commit is contained in:
parent
d76ab4da80
commit
14b46ea22b
|
@ -110,10 +110,10 @@ class FakeLoopingCall(object):
|
|||
self.call_func = func
|
||||
|
||||
def start(self, interval, **kwargs):
|
||||
intitial_delay = kwargs.pop("initial_delay", -1)
|
||||
initial_delay = kwargs.pop("initial_delay", 0)
|
||||
stop_on_exception = kwargs.pop("stop_on_exception", True)
|
||||
if intitial_delay:
|
||||
time.sleep(intitial_delay)
|
||||
if initial_delay:
|
||||
time.sleep(initial_delay)
|
||||
while True:
|
||||
try:
|
||||
self.call_func()
|
||||
|
|
Loading…
Reference in New Issue