Fix PEP8 complaints.

main
Vincent Driessen 10 years ago
parent aa3cf85531
commit 4b7c59d68d

@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# flake8: noqa
from __future__ import (absolute_import, division, print_function, from __future__ import (absolute_import, division, print_function,
unicode_literals) 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 .job import cancel_job, get_current_job, requeue_job
from .queue import get_failed_queue, Queue from .queue import get_failed_queue, Queue
from .version import VERSION 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 __version__ = VERSION

@ -1,3 +1,4 @@
# flake8: noqa
# This is a copy of the Python logging.config.dictconfig module. It is # 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. # provided here for backwards compatibility for Python versions prior to 2.7.
# #

@ -559,6 +559,7 @@ class Worker(object):
"""Pops the latest exception handler off of the exc handler stack.""" """Pops the latest exception handler off of the exc handler stack."""
return self._exc_handlers.pop() return self._exc_handlers.pop()
class SimpleWorker(Worker): class SimpleWorker(Worker):
def _install_signal_handlers(self, *args, **kwargs): def _install_signal_handlers(self, *args, **kwargs):
"""Signal handlers are useless for test worker, as it """Signal handlers are useless for test worker, as it
@ -571,4 +572,3 @@ class SimpleWorker(Worker):
def execute_job(self, *args, **kwargs): def execute_job(self, *args, **kwargs):
"""Execute job in same thread/process, do not fork()""" """Execute job in same thread/process, do not fork()"""
return self.perform_job(*args, **kwargs) return self.perform_job(*args, **kwargs)

@ -12,9 +12,11 @@ import time
from rq import Connection, get_current_job from rq import Connection, get_current_job
from rq.decorators import job from rq.decorators import job
def say_pid(): def say_pid():
return os.getpid() return os.getpid()
def say_hello(name=None): def say_hello(name=None):
"""A job with a single argument and a return value.""" """A job with a single argument and a return value."""
if name is None: if name is None:

@ -290,4 +290,4 @@ class TestWorker(RQTestCase):
self.assertEquals(w.work(burst=True), True, self.assertEquals(w.work(burst=True), True,
'Expected at least some work done.') 'Expected at least some work done.')
self.assertEquals(job.result, os.getpid(), self.assertEquals(job.result, os.getpid(),
'PID mismatch, fork() is not supposed to happen here') 'PID mismatch, fork() is not supposed to happen here')

Loading…
Cancel
Save