Author: Armin Rigo <ar...@tunes.org> Branch: Changeset: r69924:768f274ab83b Date: 2014-03-13 07:59 +0100 http://bitbucket.org/pypy/pypy/changeset/768f274ab83b/
Log: Print the content of the "sections" too, which is stdout/stderr. diff --git a/_pytest/resultlog.py b/_pytest/resultlog.py --- a/_pytest/resultlog.py +++ b/_pytest/resultlog.py @@ -51,16 +51,22 @@ 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=[]): py.builtin.print_("%s %s" % (lettercode, testpath), file=self.logfile) for line in longrepr.splitlines(): py.builtin.print_(" %s" % line, file=self.logfile) + for key, text in sections: + py.builtin.print_(" ", file=self.logfile) + py.builtin.print_(" -------------------- %s --------------------" + % key.rstrip(), file=self.logfile) + py.builtin.print_(" %s" % (text.rstrip().replace('\n', '\n '),), + 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, report.sections) 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