Commit 6e88c2d2 by bmedx

Linting fixes

parent 322de960
...@@ -4,7 +4,7 @@ Receivers of signals sent from django-user-tasks ...@@ -4,7 +4,7 @@ Receivers of signals sent from django-user-tasks
from __future__ import absolute_import, print_function, unicode_literals from __future__ import absolute_import, print_function, unicode_literals
import logging import logging
from six.moves.urllib.parse import urljoin from six.moves.urllib.parse import urljoin # pylint: disable=import-error
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.dispatch import receiver from django.dispatch import receiver
......
...@@ -4,7 +4,6 @@ Unit tests for integration of the django-user-tasks app and its REST API. ...@@ -4,7 +4,6 @@ Unit tests for integration of the django-user-tasks app and its REST API.
from __future__ import absolute_import, print_function, unicode_literals from __future__ import absolute_import, print_function, unicode_literals
import sys
from uuid import uuid4 from uuid import uuid4
import logging import logging
...@@ -23,16 +22,24 @@ from user_tasks.serializers import ArtifactSerializer, StatusSerializer ...@@ -23,16 +22,24 @@ from user_tasks.serializers import ArtifactSerializer, StatusSerializer
from .signals import user_task_stopped from .signals import user_task_stopped
# Mock logging handler to check for expected logs.
class MockLoggingHandler(logging.Handler): class MockLoggingHandler(logging.Handler):
"""
Mock logging handler to help check for logging statements
"""
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
self.reset() self.reset()
logging.Handler.__init__(self, *args, **kwargs) logging.Handler.__init__(self, *args, **kwargs)
def emit(self, record): def emit(self, record):
"""
Override to catch messages and store them messages in our internal dicts
"""
self.messages[record.levelname.lower()].append(record.getMessage()) self.messages[record.levelname.lower()].append(record.getMessage())
def reset(self): def reset(self):
"""
Clear out all messages, also called to initially populate messages dict
"""
self.messages = { self.messages = {
'debug': [], 'debug': [],
'info': [], 'info': [],
...@@ -41,8 +48,8 @@ class MockLoggingHandler(logging.Handler): ...@@ -41,8 +48,8 @@ class MockLoggingHandler(logging.Handler):
'critical': [], 'critical': [],
} }
# Helper functions for stuff that pylint complains about without disable comments
# Helper functions for stuff that pylint complains about without disable comments
def _context(response): def _context(response):
""" """
Get a context dictionary for a serializer appropriate for the given response. Get a context dictionary for a serializer appropriate for the given response.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment