From 8f66a94eab1389d97041944ed24afd2bf7c4389c Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Thu, 20 Nov 2014 16:07:03 -0500 Subject: Flake8 cleanup (mostly whitespace). Got all but a couple files in the tests (ran out of time today). Apparently I have been using some bad form for years (although a few things seemed to look better before the update). Anyway, conformant now. --- tests/plugins.py | 50 ++++++++++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 22 deletions(-) (limited to 'tests/plugins.py') diff --git a/tests/plugins.py b/tests/plugins.py index 12bac55..90c5c0d 100644 --- a/tests/plugins.py +++ b/tests/plugins.py @@ -9,9 +9,11 @@ class MarkdownSyntaxError(Exception): class Markdown(ErrorClassPlugin): """ Add MarkdownSyntaxError and ensure proper formatting. """ - mdsyntax = ErrorClass(MarkdownSyntaxError, - label='MarkdownSyntaxError', - isfailure=True) + mdsyntax = ErrorClass( + MarkdownSyntaxError, + label='MarkdownSyntaxError', + isfailure=True + ) enabled = True def configure(self, options, conf): @@ -39,28 +41,30 @@ def escape(html): class HtmlOutput(Plugin): """Output test results as ugly, unstyled html. """ - + name = 'html-output' - score = 2 # run late + score = 2 # run late enabled = True - + def __init__(self): super(HtmlOutput, self).__init__() - self.html = [ '', - 'Test output', - '' ] - + self.html = [ + '', + 'Test output', + '' + ] + def configure(self, options, conf): self.conf = conf def addSuccess(self, test): self.html.append('ok') - + def addError(self, test, err): err = self.formatErr(err) self.html.append('ERROR') self.html.append('
%s
' % escape(err)) - + def addFailure(self, test, err): err = self.formatErr(err) self.html.append('FAIL') @@ -68,9 +72,10 @@ class HtmlOutput(Plugin): def finalize(self, result): self.html.append('
') - self.html.append("Ran %d test%s" % - (result.testsRun, result.testsRun != 1 and "s" -or "")) + self.html.append( + "Ran %d test%s" % + (result.testsRun, result.testsRun != 1 and "s" or "") + ) self.html.append('
') self.html.append('
') if not result.wasSuccessful(): @@ -93,7 +98,7 @@ or "")) def formatErr(self, err): exctype, value, tb = err return ''.join(traceback.format_exception(exctype, value, tb)) - + def startContext(self, ctx): try: n = ctx.__name__ @@ -108,12 +113,13 @@ or "")) def stopContext(self, ctx): self.html.append('') - + def startTest(self, test): - self.html.extend([ '
', - test.shortDescription() or str(test), - '' ]) - + self.html.extend([ + '
', + test.shortDescription() or str(test), + '' + ]) + def stopTest(self, test): self.html.append('
') - -- cgit v1.2.3