diff --git a/rq/__init__.py b/rq/__init__.py index 0747d7a..5139266 100644 --- a/rq/__init__.py +++ b/rq/__init__.py @@ -7,7 +7,7 @@ from .connections import (Connection, get_current_connection, pop_connection, from .job import cancel_job, get_current_job, requeue_job from .queue import get_failed_queue, Queue from .version import VERSION -from .worker import Worker, WorkerTest +from .worker import Worker, SimpleWorker __all__ = [ 'use_connection', 'get_current_connection', diff --git a/rq/worker.py b/rq/worker.py index 4c288aa..be4a955 100644 --- a/rq/worker.py +++ b/rq/worker.py @@ -559,7 +559,7 @@ class Worker(object): """Pops the latest exception handler off of the exc handler stack.""" return self._exc_handlers.pop() -class WorkerTest(Worker): +class SimpleWorker(Worker): def _install_signal_handlers(self, *args, **kwargs): """Signal handlers are useless for test worker, as it does not have fork() ability""" diff --git a/tests/test_worker.py b/tests/test_worker.py index 0c168da..8aef2ac 100644 --- a/tests/test_worker.py +++ b/tests/test_worker.py @@ -4,7 +4,7 @@ from __future__ import (absolute_import, division, print_function, import os -from rq import get_failed_queue, Queue, Worker, WorkerTest +from rq import get_failed_queue, Queue, Worker, SimpleWorker from rq.compat import as_text from rq.job import Job, Status @@ -278,11 +278,11 @@ class TestWorker(RQTestCase): worker = Worker([q], job_class=CustomJob) self.assertEqual(worker.job_class, CustomJob) - def test_work_via_workertest(self): + def test_work_via_simpleworker(self): """Worker processes work, with forking disabled, then returns.""" fooq, barq = Queue('foo'), Queue('bar') - w = WorkerTest([fooq, barq]) + w = SimpleWorker([fooq, barq]) self.assertEquals(w.work(burst=True), False, 'Did not expect any work on the queue.') @@ -291,4 +291,3 @@ class TestWorker(RQTestCase): 'Expected at least some work done.') self.assertEquals(job.result, os.getpid(), 'PID mismatch, fork() is not supposed to happen here') - \ No newline at end of file