[py-svn] commit/pytest: hpk42: add header info: always report 3rd party plugins in test runs

Bitbucket commits-noreply at bitbucket.org
Wed Jun 20 00:16:56 CEST 2012


1 new commit in pytest:


https://bitbucket.org/hpk42/pytest/changeset/10adfe5e262e/
changeset:   10adfe5e262e
user:        hpk42
date:        2012-06-20 00:16:47
summary:     add header info: always report 3rd party plugins in test runs
affected #:  3 files

diff -r 247f79e22b50601a1af3a18a137ecdc5c3278e64 -r 10adfe5e262e33cc45dbf356daf1dfb5050e73d8 CHANGELOG
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -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


diff -r 247f79e22b50601a1af3a18a137ecdc5c3278e64 -r 10adfe5e262e33cc45dbf356daf1dfb5050e73d8 _pytest/terminal.py
--- a/_pytest/terminal.py
+++ b/_pytest/terminal.py
@@ -263,6 +263,17 @@
         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)


diff -r 247f79e22b50601a1af3a18a137ecdc5c3278e64 -r 10adfe5e262e33cc45dbf356daf1dfb5050e73d8 testing/test_terminal.py
--- a/testing/test_terminal.py
+++ b/testing/test_terminal.py
@@ -416,6 +416,10 @@
             "*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("""

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.



More information about the pytest-commit mailing list