From f39617a75338fc3a200cff636f851928eefb00fc Mon Sep 17 00:00:00 2001 From: Renato Alves Date: Thu, 24 Jul 2014 13:07:39 +0100 Subject: [PATCH] Unittest - Fix newlines should be interpreted in printed output --- test/simpletap/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/simpletap/__init__.py b/test/simpletap/__init__.py index afaacc87e..7dd4cfc18 100644 --- a/test/simpletap/__init__.py +++ b/test/simpletap/__init__.py @@ -66,6 +66,9 @@ class TAPTestResult(unittest.result.TestResult): def _do_stream(data, stream): """Helper function for _mergeStdout""" for line in data.splitlines(True): + # newlines should be taken literally and be comments in TAP + line = line.replace("\\n", "\n# ") + # Add a comment sign before each line if line.startswith("#"): stream.write(line)