Skip to content

Commit

Permalink
Various PEP8 fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
nvie committed Jan 30, 2015
1 parent fac2b10 commit b8d425b
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 17 deletions.
1 change: 0 additions & 1 deletion rq/queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ def enqueue_job(self, job, at_front=False):
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)
Expand Down
2 changes: 1 addition & 1 deletion rq/suspension.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ def suspend(connection, ttl=None):


def resume(connection):
return connection.delete(WORKERS_SUSPENDED)
return connection.delete(WORKERS_SUSPENDED)
2 changes: 1 addition & 1 deletion rq/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 change: 1 addition & 0 deletions rq/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function,
unicode_literals)

VERSION = '0.5.0'
7 changes: 2 additions & 5 deletions rq/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import time
import traceback
import warnings
from datetime import datetime

from rq.compat import as_text, string_types, text_type

Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -367,7 +366,6 @@ def check_for_suspension(self, burst):
if before_state:
self.set_state(before_state)


def work(self, burst=False):
"""Starts the work loop.
Expand Down Expand Up @@ -416,7 +414,6 @@ def work(self, burst=False):
self.register_death()
return did_perform_work


def dequeue_job_and_maintain_ttl(self, timeout):
result = None
qnames = self.queue_names()
Expand Down
6 changes: 0 additions & 6 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,3 @@ def test_suspend_with_invalid_ttl(self):

self.assertEqual(result.exit_code, 1)
self.assertIn("Duration must be an integer greater than 1", result.output)






2 changes: 1 addition & 1 deletion tests/test_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def test_register_dependency(self):
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)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ def test_enqueue_dependents(self):
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."""
Expand Down
2 changes: 1 addition & 1 deletion tests/test_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def test_suspend_worker_execution(self):
raise

q = Queue()
job = q.enqueue(create_file, SENTINEL_FILE)
q.enqueue(create_file, SENTINEL_FILE)

w = Worker([q])

Expand Down

0 comments on commit b8d425b

Please sign in to comment.