1 new commit in pytest:
https://bitbucket.org/hpk42/pytest/changeset/ca6adfab10e9/ changeset: ca6adfab10e9 user: hpk42 date: 2011-11-08 20:00:25 summary: fix duration option in case of collection errors affected #: 4 files diff -r a0dedb1ce96bd94b63bf97334914da22ec556b49 -r ca6adfab10e932cf4c5fdcfbe161542f2b6e7339 _pytest/__init__.py --- a/_pytest/__init__.py +++ b/_pytest/__init__.py @@ -1,2 +1,2 @@ # -__version__ = '2.2.0.dev3' +__version__ = '2.2.0.dev4' diff -r a0dedb1ce96bd94b63bf97334914da22ec556b49 -r ca6adfab10e932cf4c5fdcfbe161542f2b6e7339 _pytest/runner.py --- a/_pytest/runner.py +++ b/_pytest/runner.py @@ -28,11 +28,10 @@ duration2rep = {} alldurations = 0.0 for key, replist in tr.stats.items(): - if key == "deselected": - continue for rep in replist: - duration2rep[rep.duration] = rep - alldurations += rep.duration + if hasattr(rep, 'duration'): + duration2rep[rep.duration] = rep + alldurations += rep.duration if not duration2rep: return d2 = list(duration2rep.items()) diff -r a0dedb1ce96bd94b63bf97334914da22ec556b49 -r ca6adfab10e932cf4c5fdcfbe161542f2b6e7339 setup.py --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ name='pytest', description='py.test: simple powerful testing with Python', long_description = long_description, - version='2.2.0.dev3', + version='2.2.0.dev4', url='http://pytest.org', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], diff -r a0dedb1ce96bd94b63bf97334914da22ec556b49 -r ca6adfab10e932cf4c5fdcfbe161542f2b6e7339 testing/acceptance_test.py --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -523,6 +523,16 @@ "*call*test_1*", ]) + def test_with_failing_collection(self, testdir): + testdir.makepyfile(self.source) + testdir.makepyfile(test_collecterror="""xyz""") + result = testdir.runpytest("--durations=2", "-k test_1") + assert result.ret != 0 + result.stdout.fnmatch_lines([ + "*durations*", + "*call*test_1*", + ]) + class TestDurationWithFixture: source = """ Repository URL: https://bitbucket.org/hpk42/pytest/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. _______________________________________________ py-svn mailing list py-svn@codespeak.net http://codespeak.net/mailman/listinfo/py-svn