diff --git a/rq/cli/helpers.py b/rq/cli/helpers.py index 9ea4b58..0730d17 100644 --- a/rq/cli/helpers.py +++ b/rq/cli/helpers.py @@ -8,9 +8,8 @@ from functools import partial import click from rq import Queue, Worker -from rq.worker import WorkerStatus from rq.logutils import setup_loghandlers -from rq.suspension import is_suspended +from rq.worker import WorkerStatus red = partial(click.style, fg='red') green = partial(click.style, fg='green') diff --git a/rq/job.py b/rq/job.py index d815c5b..981694c 100644 --- a/rq/job.py +++ b/rq/job.py @@ -12,7 +12,7 @@ from rq.compat import as_text, decode_redis_hash, string_types, text_type from .connections import resolve_connection from .exceptions import NoSuchJobError, UnpickleError from .local import LocalStack -from .utils import import_attribute, utcformat, utcnow, utcparse, enum +from .utils import enum, import_attribute, utcformat, utcnow, utcparse try: import cPickle as pickle diff --git a/rq/queue.py b/rq/queue.py index e2c358c..9815f7e 100644 --- a/rq/queue.py +++ b/rq/queue.py @@ -4,15 +4,14 @@ from __future__ import (absolute_import, division, print_function, import uuid -from .connections import resolve_connection -from .job import Job, JobStatus -from .utils import import_attribute, utcnow +from redis import WatchError +from .compat import as_text, string_types, total_ordering +from .connections import resolve_connection from .exceptions import (DequeueTimeout, InvalidJobOperationError, NoSuchJobError, UnpickleError) -from .compat import total_ordering, string_types, as_text - -from redis import WatchError +from .job import Job, JobStatus +from .utils import import_attribute, utcnow def get_failed_queue(connection=None): diff --git a/rq/utils.py b/rq/utils.py index db56020..7bcb392 100644 --- a/rq/utils.py +++ b/rq/utils.py @@ -9,12 +9,12 @@ from __future__ import (absolute_import, division, print_function, unicode_literals) import calendar -import importlib import datetime +import importlib import logging import sys -from .compat import is_python_version, as_text +from .compat import as_text, is_python_version class _Colorizer(object): diff --git a/rq/worker.py b/rq/worker.py index b971a24..0c53409 100644 --- a/rq/worker.py +++ b/rq/worker.py @@ -21,11 +21,11 @@ from .exceptions import DequeueTimeout, NoQueueError from .job import Job, JobStatus from .logutils import setup_loghandlers from .queue import get_failed_queue, Queue -from .timeouts import UnixSignalDeathPenalty -from .utils import import_attribute, make_colorizer, utcformat, utcnow, enum -from .version import VERSION from .registry import FinishedJobRegistry, StartedJobRegistry from .suspension import is_suspended +from .timeouts import UnixSignalDeathPenalty +from .utils import enum, import_attribute, make_colorizer, utcformat, utcnow +from .version import VERSION try: from procname import setprocname diff --git a/tests/test_job.py b/tests/test_job.py index b7854b3..89adf6d 100644 --- a/tests/test_job.py +++ b/tests/test_job.py @@ -4,18 +4,18 @@ from __future__ import (absolute_import, division, print_function, from datetime import datetime +from tests import RQTestCase +from tests.fixtures import (access_self, CallableObject, Number, say_hello, + some_calculation) +from tests.helpers import strip_microseconds + from rq.compat import as_text, PY2 from rq.exceptions import NoSuchJobError, UnpickleError from rq.job import get_current_job, Job -from rq.registry import DeferredJobRegistry from rq.queue import Queue +from rq.registry import DeferredJobRegistry from rq.utils import utcformat -from tests import RQTestCase -from tests.fixtures import (access_self, CallableObject, Number, say_hello, - some_calculation) -from tests.helpers import strip_microseconds - try: from cPickle import loads, dumps except ImportError: diff --git a/tests/test_queue.py b/tests/test_queue.py index 369b3f1..175a1c0 100644 --- a/tests/test_queue.py +++ b/tests/test_queue.py @@ -2,16 +2,16 @@ from __future__ import (absolute_import, division, print_function, unicode_literals) +from tests import RQTestCase +from tests.fixtures import (div_by_zero, echo, Number, say_hello, + some_calculation) + from rq import get_failed_queue, Queue from rq.exceptions import InvalidJobOperationError from rq.job import Job, JobStatus from rq.registry import DeferredJobRegistry from rq.worker import Worker -from tests import RQTestCase -from tests.fixtures import (div_by_zero, echo, Number, say_hello, - some_calculation) - class CustomJob(Job): pass diff --git a/tests/test_worker.py b/tests/test_worker.py index d3b8f41..8a35d03 100644 --- a/tests/test_worker.py +++ b/tests/test_worker.py @@ -5,17 +5,17 @@ from __future__ import (absolute_import, division, print_function, import os from time import sleep -from rq import get_failed_queue, Queue, Worker, SimpleWorker -from rq.compat import as_text -from rq.job import Job, JobStatus -from rq.registry import StartedJobRegistry -from rq.suspension import suspend, resume - from tests import RQTestCase, slow from tests.fixtures import (create_file, create_file_after_timeout, - div_by_zero, say_hello, say_pid, do_nothing) + div_by_zero, do_nothing, say_hello, say_pid) from tests.helpers import strip_microseconds +from rq import get_failed_queue, Queue, SimpleWorker, Worker +from rq.compat import as_text +from rq.job import Job, JobStatus +from rq.registry import StartedJobRegistry +from rq.suspension import resume, suspend + class CustomJob(Job): pass