Various PEP8 fixes.

main
Vincent Driessen 10 years ago
parent fac2b10309
commit b8d425b318

@ -253,7 +253,6 @@ class Queue(object):
If Queue is instantiated with async=False, job is executed immediately.
"""
with self.connection._pipeline() as pipeline:
# Add Queue key set
self.connection.sadd(self.redis_queues_keys, self.key)

@ -15,4 +15,4 @@ def suspend(connection, ttl=None):
def resume(connection):
return connection.delete(WORKERS_SUSPENDED)
return connection.delete(WORKERS_SUSPENDED)

@ -217,4 +217,4 @@ def enum(name, *sequential, **named):
# On Python 2 type() requires a byte string (which is str() on Python 2).
# On Python 3 it does not matter, so we'll use str(), which acts as
# a no-op.
return type(str(name), (), values)
return type(str(name), (), values)

@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function,
unicode_literals)
VERSION = '0.5.0'

@ -12,7 +12,6 @@ import sys
import time
import traceback
import warnings
from datetime import datetime
from rq.compat import as_text, string_types, text_type
@ -54,8 +53,8 @@ def compact(l):
return [x for x in l if x is not None]
_signames = dict((getattr(signal, signame), signame)
for signame in dir(signal)
if signame.startswith('SIG') and '_' not in signame)
for signame in dir(signal)
if signame.startswith('SIG') and '_' not in signame)
def signal_name(signum):
@ -367,7 +366,6 @@ class Worker(object):
if before_state:
self.set_state(before_state)
def work(self, burst=False):
"""Starts the work loop.
@ -416,7 +414,6 @@ class Worker(object):
self.register_death()
return did_perform_work
def dequeue_job_and_maintain_ttl(self, timeout):
result = None
qnames = self.queue_names()

@ -101,9 +101,3 @@ class TestRQCli(RQTestCase):
self.assertEqual(result.exit_code, 1)
self.assertIn("Duration must be an integer greater than 1", result.output)

@ -339,7 +339,7 @@ class TestJob(RQTestCase):
job = Job.create(func=say_hello, origin=origin)
job._dependency_id = 'id'
job.save()
self.assertEqual(registry.get_job_ids(), [])
job.register_dependency()
self.assertEqual(as_text(self.testconn.spop('rq:job:id:dependents')), job.id)

@ -340,7 +340,7 @@ class TestQueue(RQTestCase):
self.assertFalse(self.testconn.exists(parent_job.dependents_key))
# DeferredJobRegistry should also be empty
self.assertEqual(registry.get_job_ids(), [])
self.assertEqual(registry.get_job_ids(), [])
def test_enqueue_job_with_dependency(self):
"""Jobs are enqueued only when their dependencies are finished."""

@ -334,7 +334,7 @@ class TestWorker(RQTestCase):
raise
q = Queue()
job = q.enqueue(create_file, SENTINEL_FILE)
q.enqueue(create_file, SENTINEL_FILE)
w = Worker([q])

Loading…
Cancel
Save