add header info: always report 3rd party plugins in test runs

This commit is contained in:
holger krekel 2012-06-20 00:16:47 +02:00
parent 1bbe1d086c
commit 18306a4644
3 changed files with 16 additions and 0 deletions

View File

@ -1,6 +1,7 @@
Changes between 2.2.4 and 2.2.5.dev
-----------------------------------
- always report installed 3rd party plugins
- fix issue160: a failing setup of an xfail-marked tests should
be reported as xfail (not xpass)
- fix issue128: show captured output when capsys/capfd are used

View File

@ -263,6 +263,17 @@ class TerminalReporter:
for line in flatten(lines):
self.write_line(line)
def pytest_report_header(self, config):
plugininfo = config.pluginmanager._plugin_distinfo
if plugininfo:
l = []
for dist, plugin in plugininfo:
name = dist.project_name
if name.startswith("pytest-"):
name = name[7:]
l.append(name)
return "plugins: %s" % ", ".join(l)
def pytest_collection_finish(self, session):
if self.config.option.collectonly:
self._printcollecteditems(session.items)

View File

@ -416,6 +416,10 @@ class TestTerminalFunctional:
"*test_header_trailer_info.py .",
"=* 1 passed in *.[0-9][0-9] seconds *=",
])
if pytest.config.pluginmanager._plugin_distinfo:
result.stdout.fnmatch_lines([
"plugins: *",
])
def test_showlocals(self, testdir):
p1 = testdir.makepyfile("""