From 4b7c59d68dc52ea7f35ac96448f8e9a93515e5e3 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Mon, 8 Sep 2014 20:29:24 +0200 Subject: [PATCH] Fix PEP8 complaints. --- rq/__init__.py | 8 ++------ rq/compat/dictconfig.py | 1 + rq/worker.py | 2 +- tests/fixtures.py | 2 ++ tests/test_worker.py | 2 +- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/rq/__init__.py b/rq/__init__.py index 5139266..0e55f1b 100644 --- a/rq/__init__.py +++ b/rq/__init__.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- +# flake8: noqa from __future__ import (absolute_import, division, print_function, unicode_literals) @@ -7,11 +8,6 @@ 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, SimpleWorker +from .worker import SimpleWorker, Worker -__all__ = [ - 'use_connection', 'get_current_connection', - 'push_connection', 'pop_connection', 'Connection', - 'Queue', 'get_failed_queue', 'Worker', - 'cancel_job', 'requeue_job', 'get_current_job'] __version__ = VERSION diff --git a/rq/compat/dictconfig.py b/rq/compat/dictconfig.py index 56321bc..81e5b06 100644 --- a/rq/compat/dictconfig.py +++ b/rq/compat/dictconfig.py @@ -1,3 +1,4 @@ +# flake8: noqa # This is a copy of the Python logging.config.dictconfig module. It is # provided here for backwards compatibility for Python versions prior to 2.7. # diff --git a/rq/worker.py b/rq/worker.py index be4a955..eea5e65 100644 --- a/rq/worker.py +++ b/rq/worker.py @@ -559,6 +559,7 @@ class Worker(object): """Pops the latest exception handler off of the exc handler stack.""" return self._exc_handlers.pop() + class SimpleWorker(Worker): def _install_signal_handlers(self, *args, **kwargs): """Signal handlers are useless for test worker, as it @@ -571,4 +572,3 @@ class SimpleWorker(Worker): def execute_job(self, *args, **kwargs): """Execute job in same thread/process, do not fork()""" return self.perform_job(*args, **kwargs) - diff --git a/tests/fixtures.py b/tests/fixtures.py index fc7d64f..a0e8eba 100644 --- a/tests/fixtures.py +++ b/tests/fixtures.py @@ -12,9 +12,11 @@ import time from rq import Connection, get_current_job from rq.decorators import job + def say_pid(): return os.getpid() + def say_hello(name=None): """A job with a single argument and a return value.""" if name is None: diff --git a/tests/test_worker.py b/tests/test_worker.py index 8aef2ac..7a9aadf 100644 --- a/tests/test_worker.py +++ b/tests/test_worker.py @@ -290,4 +290,4 @@ class TestWorker(RQTestCase): self.assertEquals(w.work(burst=True), True, 'Expected at least some work done.') self.assertEquals(job.result, os.getpid(), - 'PID mismatch, fork() is not supposed to happen here') + 'PID mismatch, fork() is not supposed to happen here')