From 9c2d35364019e8efeb8c0958d3d440b6b911f336 Mon Sep 17 00:00:00 2001 From: lowercase00 <21188280+lowercase00@users.noreply.github.com> Date: Wed, 25 Jan 2023 04:42:04 -0300 Subject: [PATCH] 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. --- rq/dummy.py | 38 -------------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 rq/dummy.py diff --git a/rq/dummy.py b/rq/dummy.py deleted file mode 100644 index 12f360b5..00000000 --- a/rq/dummy.py +++ /dev/null @@ -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'