From 7b1138bc603a30e1e79f00e094993fcca167f2fc Mon Sep 17 00:00:00 2001 From: Selwin Ong Date: Tue, 29 Oct 2024 20:21:35 +0700 Subject: [PATCH] Use `Worker` instead of `SimpleWorker` in test --- tests/test_callbacks.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/test_callbacks.py b/tests/test_callbacks.py index 025b249..c3ba833 100644 --- a/tests/test_callbacks.py +++ b/tests/test_callbacks.py @@ -5,7 +5,7 @@ from rq import Queue, Worker from rq.job import Job, JobStatus, UNEVALUATED -from rq.worker import SimpleWorker +from rq.worker import SimpleWorker, Worker class QueueCallbackTestCase(RQTestCase): @@ -81,7 +81,7 @@ def test_erroneous_success_callback(self): def test_failure_callback(self): """Test failure callback is executed only when job a fails""" queue = Queue(connection=self.testconn) - worker = SimpleWorker([queue], connection=self.testconn) + worker = Worker([queue], connection=self.testconn) job = queue.enqueue(div_by_zero, on_failure=save_exception) @@ -89,7 +89,6 @@ def test_failure_callback(self): worker.work(burst=True) self.assertEqual(job.get_status(), JobStatus.FAILED) job.refresh() - print(job.exc_info) self.assertIn('div_by_zero', self.testconn.get('failure_callback:%s' % job.id).decode())