Commit e8d6b398 authored by Denis Bilenko's avatar Denis Bilenko

testrunner.py: pep8

parent cca816e2
...@@ -190,9 +190,12 @@ def run_tests(options, args): ...@@ -190,9 +190,12 @@ def run_tests(options, args):
module_name = arg module_name = arg
if module_name.endswith('.py'): if module_name.endswith('.py'):
module_name = module_name[:-3] module_name = module_name[:-3]
class _runner(object): class _runner(object):
def __new__(cls, *args, **kawrgs): def __new__(cls, *args, **kawrgs):
return DatabaseTestRunner(database_path=options.db, runid=options.runid, module_name=module_name, verbosity=options.verbosity) return DatabaseTestRunner(database_path=options.db, runid=options.runid, module_name=module_name, verbosity=options.verbosity)
if options.db: if options.db:
import unittest import unittest
unittest.TextTestRunner = _runner unittest.TextTestRunner = _runner
...@@ -419,7 +422,7 @@ def get_traceback_stats(output, test): ...@@ -419,7 +422,7 @@ def get_traceback_stats(output, test):
traceback_count -= 1 traceback_count -= 1
items = counter.items() items = counter.items()
items.sort(key=lambda (a, b): -b) items.sort(key=lambda (a, b): -b)
if traceback_count>0: if traceback_count > 0:
items.append(('other traceback', traceback_count)) items.append(('other traceback', traceback_count))
result = [] result = []
for name, count in items: for name, count in items:
...@@ -431,7 +434,7 @@ def get_traceback_stats(output, test): ...@@ -431,7 +434,7 @@ def get_traceback_stats(output, test):
def get_info(output, test): def get_info(output, test):
output = output[:OUTPUT_LIMIT*2] output = output[:OUTPUT_LIMIT * 2]
traceback_stats, ignored_list = get_traceback_stats(output, test) traceback_stats, ignored_list = get_traceback_stats(output, test)
warning_stats = get_warning_stats(output) warning_stats = get_warning_stats(output)
result = traceback_stats + warning_stats result = traceback_stats + warning_stats
......
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