[cleanup] Fix some linting issues

This commit is contained in:
Bastien Vallet
2020-06-10 12:00:55 +02:00
parent 68d95a2924
commit 3569d2ea8c
5 changed files with 15 additions and 12 deletions
+9 -4
View File
@@ -45,6 +45,7 @@ def test_sync(broker):
task = async_task('django_q.tests.tasks.count_letters', DEFAULT_WORDLIST, broker=broker, sync=True)
assert result(task) == 1506
@pytest.mark.django_db
def test_sync_raise_exception(broker):
with pytest.raises(TaskError):
@@ -401,6 +402,7 @@ def test_update_failed(broker):
assert saved_task.success is True
assert saved_task.result == 'result'
@pytest.mark.django_db
def test_acknowledge_failure_override():
class VerifyAckMockBroker(Broker):
@@ -434,10 +436,12 @@ def test_acknowledge_failure_override():
tag = uuid()
task_success_ack = task_fail_ack.copy()
task_success_ack.update({'id': tag[1],
'name': tag[0],
'ack_id': 'test_success_ack_id',
'success': True,})
task_success_ack.update({
'id': tag[1],
'name': tag[0],
'ack_id': 'test_success_ack_id',
'success': True,
})
del task_success_ack['ack_failure']
result_queue = Queue()
@@ -453,6 +457,7 @@ def test_acknowledge_failure_override():
assert broker.acknowledgements.get('test_fail_no_ack_id') is None
assert broker.acknowledgements.get('test_success_ack_id') == 1
@pytest.mark.django_db
def assert_result(task):
assert task is not None