summaryrefslogtreecommitdiff
path: root/tests/test_worker.py
diff options
context:
space:
mode:
authorXavier Fernandez <xav.fernandez@gmail.com>2022-02-13 10:15:07 +0100
committerGitHub <noreply@github.com>2022-02-13 16:15:07 +0700
commitcd17d17d71425cb75e887f3815cb5502d9a613e8 (patch)
treeca6b7992f7b1deb1a9778d4e50f65ed1624117dc /tests/test_worker.py
parent947f8eed33a2e066fa14a87987fd52e7e292d993 (diff)
downloadrq-cd17d17d71425cb75e887f3815cb5502d9a613e8.tar.gz
rq.worker: remove useless set_state call in horse (#1618)
* rq.worker: remove useless set_state call in horse The state should already have been set properly by the worker in `execute_job` `prepare_job_execution` is only called by `perform_job` which should only be called by `main_work_horse`/`fork_work_horse` (themselves only called by `execute_job`). Let `execute_job` do the bookkeeping. * worker: update SimpleWorker's state in execute_job
Diffstat (limited to 'tests/test_worker.py')
-rw-r--r--tests/test_worker.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/test_worker.py b/tests/test_worker.py
index 0e944c2..3f865a2 100644
--- a/tests/test_worker.py
+++ b/tests/test_worker.py
@@ -797,8 +797,7 @@ class TestWorker(RQTestCase):
registry = StartedJobRegistry(connection=self.testconn)
self.assertEqual(registry.get_job_ids(), [job.id])
- # Updates worker statuses
- self.assertEqual(worker.get_state(), 'busy')
+ # Updates worker's current job
self.assertEqual(worker.get_current_job_id(), job.id)
# job status is also updated