From 4c721d0ab50d7251d8c821d50565ec071ea749c5 Mon Sep 17 00:00:00 2001 From: Aaron Westendorf Date: Mon, 5 May 2014 21:43:49 -0400 Subject: [PATCH] more pep8 --- chai/comparators.py | 3 ++- chai/exception.py | 17 +++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/chai/comparators.py b/chai/comparators.py index 037276e..49a2ddb 100644 --- a/chai/comparators.py +++ b/chai/comparators.py @@ -124,7 +124,8 @@ def test(self, value): return round(value - self._float_value, self._places) == 0 def __repr__(self): - return "AlmostEqual(value: %s, places: %d)" % (str(self._float_value), self._places) + return "AlmostEqual(value: %s, places: %d)" % ( + str(self._float_value), self._places) __str__ = __repr__ diff --git a/chai/exception.py b/chai/exception.py index aa5e79a..080d9ad 100644 --- a/chai/exception.py +++ b/chai/exception.py @@ -15,7 +15,8 @@ def pretty_format_args(*args, **kwargs): """ - Take the args, and kwargs that are passed them and format in a prototype style. + Take the args, and kwargs that are passed them and format in a + prototype style. """ args = list([repr(a) for a in args]) for key, value in kwargs.items(): @@ -50,7 +51,9 @@ class UnexpectedCall(BaseException): Raised when a unexpected call occurs to a stub. ''' - def __init__(self, msg=None, prefix=None, suffix=None, call=None, args=None, kwargs=None, expected_args=None, expected_kwargs=None): + def __init__(self, msg=None, prefix=None, suffix=None, call=None, + args=None, kwargs=None, expected_args=None, + expected_kwargs=None): if msg: msg = colored('\n\n' + msg.strip(), 'red') else: @@ -69,14 +72,16 @@ def __init__(self, msg=None, prefix=None, suffix=None, call=None, args=None, kwa if expected_args or expected_kwargs: msg += colored('\n\nExpected\n', 'white', attrs=['bold']) msg += colored(call, 'red') - msg += colored(pretty_format_args(*(expected_args or ()), - **(expected_kwargs or {})), 'red') + msg += colored(pretty_format_args( + *(expected_args or ()), + **(expected_kwargs or {})), 'red') # If handling an exception, add printing of it here. if sys.exc_info()[0]: msg += colored('\n\nWhile handling\n', 'white', attrs=['bold']) - msg += colored(''.join(traceback.format_exception(* - sys.exc_info())), 'red') + msg += colored(''.join( + traceback.format_exception(*sys.exc_info())), + 'red') if suffix: msg = msg + '\n\n' + suffix.strip()