mirror of https://github.com/celery/kombu.git
tests didn't pass fxrange
This commit is contained in:
parent
387e979840
commit
eed34140ae
|
@ -182,7 +182,7 @@ def insomnia(fun):
|
||||||
return _inner
|
return _inner
|
||||||
|
|
||||||
|
|
||||||
class test_retry_over_Time(unittest.TestCase):
|
class test_retry_over_time(unittest.TestCase):
|
||||||
|
|
||||||
@insomnia
|
@insomnia
|
||||||
def test_simple(self):
|
def test_simple(self):
|
||||||
|
@ -193,15 +193,15 @@ class test_retry_over_Time(unittest.TestCase):
|
||||||
|
|
||||||
def myfun():
|
def myfun():
|
||||||
sleepvals = {0: None,
|
sleepvals = {0: None,
|
||||||
1: 2,
|
1: 2.0,
|
||||||
2: 4,
|
2: 4.0,
|
||||||
3: 6,
|
3: 6.0,
|
||||||
4: 8,
|
4: 8.0,
|
||||||
5: 10,
|
5: 10.0,
|
||||||
6: 12,
|
6: 12.0,
|
||||||
7: 14,
|
7: 14.0,
|
||||||
8: 14,
|
8: 16.0,
|
||||||
9: 14}
|
9: 16.0}
|
||||||
self.assertEqual(_tried_to_sleep[0], sleepvals[index[0]])
|
self.assertEqual(_tried_to_sleep[0], sleepvals[index[0]])
|
||||||
if index[0] < 9:
|
if index[0] < 9:
|
||||||
raise Predicate()
|
raise Predicate()
|
||||||
|
|
|
@ -62,7 +62,8 @@ def fxrange(start=1.0, stop=None, step=1.0, repeatlast=False):
|
||||||
while 1:
|
while 1:
|
||||||
if cur <= stop:
|
if cur <= stop:
|
||||||
yield cur
|
yield cur
|
||||||
cur += step
|
if cur + step <= stop:
|
||||||
|
cur += step
|
||||||
else:
|
else:
|
||||||
if not repeatlast:
|
if not repeatlast:
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in New Issue