From 99a1188287c913965a25d52194948a8468b7b8c6 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Tue, 8 Nov 2011 20:57:19 +0000 Subject: [PATCH] simplify durations output, no percentage, no "remaining" bits --- _pytest/__init__.py | 2 +- _pytest/runner.py | 20 ++++++++------------ setup.py | 2 +- testing/acceptance_test.py | 2 -- 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/_pytest/__init__.py b/_pytest/__init__.py index 8159b045e..264b6f021 100644 --- a/_pytest/__init__.py +++ b/_pytest/__init__.py @@ -1,2 +1,2 @@ # -__version__ = '2.2.0.dev4' +__version__ = '2.2.0.dev5' diff --git a/_pytest/runner.py b/_pytest/runner.py index 7f0fc63bf..5fc4f6360 100644 --- a/_pytest/runner.py +++ b/_pytest/runner.py @@ -26,35 +26,31 @@ def pytest_terminal_summary(terminalreporter): return tr = terminalreporter duration2rep = {} - alldurations = 0.0 for key, replist in tr.stats.items(): for rep in replist: if hasattr(rep, 'duration'): duration2rep[rep.duration] = rep - alldurations += rep.duration if not duration2rep: return d2 = list(duration2rep.items()) d2.sort() d2.reverse() - remaining = [] + #remaining = [] if not durations: tr.write_sep("=", "slowest test durations") else: tr.write_sep("=", "slowest %s test durations" % durations) - remaining = d2[durations:] + #remaining = d2[durations:] d2 = d2[:durations] - assert (alldurations/100) > 0 for duration, rep in d2: nodeid = rep.nodeid.replace("::()::", "::") - percent = rep.duration / (alldurations / 100) - tr.write_line("%02.2fs %-02.2f%% %s %s" % - (duration, percent, rep.when, nodeid)) - if remaining: - remsum = sum(map(lambda x: x[0], remaining)) - tr.write_line("%02.2fs %-02.2f%% remaining in %d test phases" %( - remsum, remsum / (alldurations / 100), len(remaining))) + tr.write_line("%02.2fs %s %s" % + (duration, rep.when, nodeid)) + #if remaining: + # remsum = sum(map(lambda x: x[0], remaining)) + # tr.write_line("%02.2fs spent in %d remaining test phases" %( + # remsum, len(remaining))) def pytest_sessionstart(session): diff --git a/setup.py b/setup.py index 44020707a..7ef9908e9 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.dev4', + version='2.2.0.dev5', url='http://pytest.org', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index 299b016e6..85f137287 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -487,7 +487,6 @@ class TestDurations: "*call*test_2*", "*call*test_1*", ]) - assert "remaining in" not in result.stdout.str() def test_calls_show_2(self, testdir): testdir.makepyfile(self.source) @@ -497,7 +496,6 @@ class TestDurations: "*durations*", "*call*test_3*", "*call*test_2*", - "*s*%*remaining in 7 test phases", ]) assert "test_1" not in result.stdout.str()