Author: Armin Rigo <ar...@tunes.org>
Branch: 
Changeset: r73254:93a97c795531
Date: 2014-09-01 08:44 +0200
http://bitbucket.org/pypy/pypy/changeset/93a97c795531/

Log:    Attempt to get the stdout/stderr as well in the written resultlogs.

diff --git a/_pytest/resultlog.py b/_pytest/resultlog.py
--- a/_pytest/resultlog.py
+++ b/_pytest/resultlog.py
@@ -53,16 +53,23 @@
         self.config = config
         self.logfile = logfile # preferably line buffered
 
-    def write_log_entry(self, testpath, lettercode, longrepr):
+    def write_log_entry(self, testpath, lettercode, longrepr, sections=None):
         py.builtin.print_("%s %s" % (lettercode, testpath), file=self.logfile)
         for line in longrepr.splitlines():
             py.builtin.print_(" %s" % line, file=self.logfile)
+        if sections is not None:
+            for title, content in sections:
+                py.builtin.print_(" ---------- %s ----------" % (title,),
+                                  file=self.logfile)
+                for line in content.splitlines():
+                    py.builtin.print_(" %s" % line, file=self.logfile)
 
     def log_outcome(self, report, lettercode, longrepr):
         testpath = getattr(report, 'nodeid', None)
         if testpath is None:
             testpath = report.fspath
-        self.write_log_entry(testpath, lettercode, longrepr)
+        self.write_log_entry(testpath, lettercode, longrepr,
+                             getattr(report, 'sections', None))
 
     def pytest_runtest_logreport(self, report):
         if report.when != "call" and report.passed:
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to