diff --git a/_pytest/__init__.py b/_pytest/__init__.py index e20364058..c552852e3 100644 --- a/_pytest/__init__.py +++ b/_pytest/__init__.py @@ -1,2 +1,2 @@ # -__version__ = '2.2.0.dev10' +__version__ = '2.2.0.dev11' diff --git a/_pytest/runner.py b/_pytest/runner.py index d41b3c1a5..d4afad96f 100644 --- a/_pytest/runner.py +++ b/_pytest/runner.py @@ -25,23 +25,22 @@ def pytest_terminal_summary(terminalreporter): if durations is None: return tr = terminalreporter - duration2rep = {} - for key, replist in tr.stats.items(): + dlist = [] + for replist in tr.stats.values(): for rep in replist: if hasattr(rep, 'duration'): - duration2rep[rep.duration] = rep - if not duration2rep: + dlist.append((rep.duration, rep)) + if not dlist: return - d2 = list(duration2rep.items()) - d2.sort() - d2.reverse() + dlist.sort() + dlist.reverse() if not durations: tr.write_sep("=", "slowest test durations") else: tr.write_sep("=", "slowest %s test durations" % durations) - d2 = d2[:durations] + dlist = dlist[:durations] - for duration, rep in d2: + for duration, rep in dlist: nodeid = rep.nodeid.replace("::()::", "::") tr.write_line("%02.2fs %-8s %s" % (duration, rep.when, nodeid)) diff --git a/setup.py b/setup.py index b6d330db0..cd2b41c72 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ def main(): name='pytest', description='py.test: simple powerful testing with Python', long_description = long_description, - version='2.2.0.dev10', + version='2.2.0.dev11', url='http://pytest.org', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],