mirror of https://github.com/rq/rq.git
Remove unused dummy tasks (#1760)
Dummy tasks were probably used for load testing in the past, but currently are not being imported from anywhere. Also, similar task utilities are already present on the tests fixtures, making the `dummy` module irrelevant.
This commit is contained in:
parent
e163e224e2
commit
9c2d353640
38
rq/dummy.py
38
rq/dummy.py
|
@ -1,38 +0,0 @@
|
|||
"""
|
||||
Some dummy tasks that are well-suited for generating load for testing purposes.
|
||||
"""
|
||||
|
||||
import random
|
||||
import time
|
||||
|
||||
|
||||
def do_nothing():
|
||||
pass
|
||||
|
||||
|
||||
def sleep(secs: int):
|
||||
time.sleep(secs)
|
||||
|
||||
|
||||
def endless_loop():
|
||||
while True:
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
def div_by_zero():
|
||||
1 / 0
|
||||
|
||||
|
||||
def fib(n: int):
|
||||
if n <= 1:
|
||||
return 1
|
||||
else:
|
||||
return fib(n - 2) + fib(n - 1)
|
||||
|
||||
|
||||
def random_failure():
|
||||
if random.choice([True, False]):
|
||||
class RandomError(Exception):
|
||||
pass
|
||||
raise RandomError('Ouch!')
|
||||
return 'OK'
|
Loading…
Reference in New Issue