Skip to content

Commit

Permalink
Fix tests for python 2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
insolite committed Aug 29, 2016
1 parent e2d85b9 commit daa00db
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/structlog/formatters.py
Expand Up @@ -21,7 +21,7 @@ class ProcessorFormatter(logging.Formatter):

def __init__(self, processor, fmt=None, datefmt=None, style='%'):
"""Keep reference to the ``processor``."""
super().__init__(fmt=fmt, datefmt=datefmt, style=style)
super(ProcessorFormatter, self).__init__(fmt=fmt, datefmt=datefmt, style=style)
self.processor = processor

def format(self, record):
Expand Down
10 changes: 5 additions & 5 deletions tests/test_formatters.py
Expand Up @@ -27,12 +27,12 @@ def test_format__dict(self):
extra={'_name': 'debug',
'_logger': logger})
expected_repr = 'Record representation'
ppr = processor_factory(expected_repr)
processor_formatter = ProcessorFormatter(ppr)
processor = processor_factory(expected_repr)
processor_formatter = ProcessorFormatter(processor)

actual_repr = processor_formatter.format(record)

assert ppr.args == [record._logger, record._name, record.msg.copy()]
assert processor.args == [record._logger, record._name, record.msg.copy()]
assert expected_repr == actual_repr

def test_format__not_dict(self):
Expand All @@ -47,8 +47,8 @@ def test_format__not_dict(self):
extra={'_name': 'debug',
'_logger': logger})
expected_repr = record.getMessage()
ppr = processor_factory(expected_repr)
processor_formatter = ProcessorFormatter(ppr)
processor = processor_factory(expected_repr)
processor_formatter = ProcessorFormatter(processor)

actual_repr = processor_formatter.format(record)

Expand Down

0 comments on commit daa00db

Please sign in to comment.