From ea5186716e64e8feec76eb114b12935578b809fb Mon Sep 17 00:00:00 2001 From: Renato Alves Date: Tue, 15 Jul 2014 03:02:47 +0100 Subject: [PATCH] Unittest - Example of TAP diag use in template.t * Also prettify its output with the amazing whitespace --- test/basetest/testing.py | 2 +- test/template.t | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/test/basetest/testing.py b/test/basetest/testing.py index b8e03e9c7..e90f81b46 100644 --- a/test/basetest/testing.py +++ b/test/basetest/testing.py @@ -8,7 +8,7 @@ class TestCase(unittest.TestCase): def diag(self, out): sys.stdout.write("# --- diag start ---\n") for line in out.split("\n"): - sys.stdout.write("#" + line + "\n") + sys.stdout.write("# " + line + "\n") sys.stdout.write("# --- diag end ---\n") diff --git a/test/template.t b/test/template.t index 6bfb83a43..0851dafa8 100755 --- a/test/template.t +++ b/test/template.t @@ -34,6 +34,9 @@ class TestBugNumber(TestCase): expected = "Copyright \(C\) \d{4} - %d" % (datetime.now().year,) self.assertRegexpMatches(out.decode("utf8"), expected) + # TAP diagnostics on the bas + self.diag("Yay TAP diagnostics") + def test_fail_other(self): """Nothing to do with Copyright""" self.assertEqual("I like to code", "I like\nto code\n")