mirror of https://github.com/rq/rq.git
Flake8.
This commit is contained in:
parent
000849c430
commit
9ac9c23412
|
@ -3,30 +3,33 @@ This file contains all jobs that are used in tests. Each of these test
|
||||||
fixtures has a slighty different characteristics.
|
fixtures has a slighty different characteristics.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
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:
|
||||||
name = 'Stranger'
|
name = 'Stranger'
|
||||||
return 'Hi there, %s!' % (name,)
|
return 'Hi there, %s!' % (name,)
|
||||||
|
|
||||||
|
|
||||||
def do_nothing():
|
def do_nothing():
|
||||||
"""The best job in the world."""
|
"""The best job in the world."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
def div_by_zero(x):
|
def div_by_zero(x):
|
||||||
"""Prepare for a division-by-zero exception."""
|
"""Prepare for a division-by-zero exception."""
|
||||||
return x / 0
|
return x / 0
|
||||||
|
|
||||||
|
|
||||||
def some_calculation(x, y, z=1):
|
def some_calculation(x, y, z=1):
|
||||||
"""Some arbitrary calculation with three numbers. Choose z smartly if you
|
"""Some arbitrary calculation with three numbers. Choose z smartly if you
|
||||||
want a division by zero exception.
|
want a division by zero exception.
|
||||||
"""
|
"""
|
||||||
return x * y / z
|
return x * y / z
|
||||||
|
|
||||||
|
|
||||||
def create_file(path):
|
def create_file(path):
|
||||||
"""Creates a file at the given path. Actually, leaves evidence that the
|
"""Creates a file at the given path. Actually, leaves evidence that the
|
||||||
job ran."""
|
job ran."""
|
||||||
with open(path, 'w') as f:
|
with open(path, 'w') as f:
|
||||||
f.write('Just a sentinel.')
|
f.write('Just a sentinel.')
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue