From 7550bff63d9ae858507513d411dbf8ade0015f27 Mon Sep 17 00:00:00 2001 From: Cody D'Ambrosio Date: Wed, 3 Dec 2025 14:07:00 -0500 Subject: [PATCH 01/14] Update tracker.py --- src/tap/tracker.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tap/tracker.py b/src/tap/tracker.py index e208459..f76e643 100644 --- a/src/tap/tracker.py +++ b/src/tap/tracker.py @@ -73,23 +73,25 @@ def _track(self, class_name): if self.combined: self.combined_test_cases_seen.append(class_name) - def add_ok(self, class_name, description, directive="", diagnostics=None): + def add_ok(self, class_name, description, directive="", diagnostics=None, raw_yaml_block=None): result = Result( ok=True, number=self._get_next_line_number(class_name), description=description, diagnostics=diagnostics, directive=Directive(directive), + raw_yaml_block=raw_yaml_block, ) self._add_line(class_name, result) - def add_not_ok(self, class_name, description, directive="", diagnostics=None): + def add_not_ok(self, class_name, description, directive="", diagnostics=None, raw_yaml_block=None): result = Result( ok=False, number=self._get_next_line_number(class_name), description=description, diagnostics=diagnostics, directive=Directive(directive), + raw_yaml_block=raw_yaml_block ) self._add_line(class_name, result) From d1d9a70ec0d235df41deb186cb2f1983f5720882 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 3 Dec 2025 19:08:53 +0000 Subject: [PATCH 02/14] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/tap/tracker.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/tap/tracker.py b/src/tap/tracker.py index f76e643..b9945dc 100644 --- a/src/tap/tracker.py +++ b/src/tap/tracker.py @@ -73,7 +73,14 @@ def _track(self, class_name): if self.combined: self.combined_test_cases_seen.append(class_name) - def add_ok(self, class_name, description, directive="", diagnostics=None, raw_yaml_block=None): + def add_ok( + self, + class_name, + description, + directive="", + diagnostics=None, + raw_yaml_block=None, + ): result = Result( ok=True, number=self._get_next_line_number(class_name), @@ -84,14 +91,21 @@ def add_ok(self, class_name, description, directive="", diagnostics=None, raw_ya ) self._add_line(class_name, result) - def add_not_ok(self, class_name, description, directive="", diagnostics=None, raw_yaml_block=None): + def add_not_ok( + self, + class_name, + description, + directive="", + diagnostics=None, + raw_yaml_block=None, + ): result = Result( ok=False, number=self._get_next_line_number(class_name), description=description, diagnostics=diagnostics, directive=Directive(directive), - raw_yaml_block=raw_yaml_block + raw_yaml_block=raw_yaml_block, ) self._add_line(class_name, result) From e7a16943444cd8156de488a31323476f41d41aff Mon Sep 17 00:00:00 2001 From: Cody D'Ambrosio Date: Thu, 4 Dec 2025 09:23:00 -0500 Subject: [PATCH 03/14] add yaml to result --- src/tap/line.py | 7 ++++++- src/tap/tracker.py | 20 +++----------------- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/src/tap/line.py b/src/tap/line.py index a48f839..21173d0 100644 --- a/src/tap/line.py +++ b/src/tap/line.py @@ -111,7 +111,12 @@ def __str__(self): diagnostics = "" if self.diagnostics is not None: diagnostics = "\n" + self.diagnostics.rstrip() - return f"{is_not}ok {self.number} {self.description}{directive}{diagnostics}" + yaml_block = "" + if self._yaml_block is not None: + indent = " " + indented_yaml_block = '\n'.join(f"{indent}{line}" for line in self._yaml_block.splitlines()) + yaml_block = f"\n{indent}---\n{indented_yaml_block}\n{indent}..." + return f"{is_not}ok {self.number} {self.description}{directive}{diagnostics}{yaml_block}" class Plan(Line): diff --git a/src/tap/tracker.py b/src/tap/tracker.py index b9945dc..f76e643 100644 --- a/src/tap/tracker.py +++ b/src/tap/tracker.py @@ -73,14 +73,7 @@ def _track(self, class_name): if self.combined: self.combined_test_cases_seen.append(class_name) - def add_ok( - self, - class_name, - description, - directive="", - diagnostics=None, - raw_yaml_block=None, - ): + def add_ok(self, class_name, description, directive="", diagnostics=None, raw_yaml_block=None): result = Result( ok=True, number=self._get_next_line_number(class_name), @@ -91,21 +84,14 @@ def add_ok( ) self._add_line(class_name, result) - def add_not_ok( - self, - class_name, - description, - directive="", - diagnostics=None, - raw_yaml_block=None, - ): + def add_not_ok(self, class_name, description, directive="", diagnostics=None, raw_yaml_block=None): result = Result( ok=False, number=self._get_next_line_number(class_name), description=description, diagnostics=diagnostics, directive=Directive(directive), - raw_yaml_block=raw_yaml_block, + raw_yaml_block=raw_yaml_block ) self._add_line(class_name, result) From bb73fda609bd93198db13ac0ee0df928b6036703 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 4 Dec 2025 14:23:08 +0000 Subject: [PATCH 04/14] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/tap/line.py | 4 +++- src/tap/tracker.py | 20 +++++++++++++++++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/tap/line.py b/src/tap/line.py index 21173d0..cdacbc1 100644 --- a/src/tap/line.py +++ b/src/tap/line.py @@ -114,7 +114,9 @@ def __str__(self): yaml_block = "" if self._yaml_block is not None: indent = " " - indented_yaml_block = '\n'.join(f"{indent}{line}" for line in self._yaml_block.splitlines()) + indented_yaml_block = "\n".join( + f"{indent}{line}" for line in self._yaml_block.splitlines() + ) yaml_block = f"\n{indent}---\n{indented_yaml_block}\n{indent}..." return f"{is_not}ok {self.number} {self.description}{directive}{diagnostics}{yaml_block}" diff --git a/src/tap/tracker.py b/src/tap/tracker.py index f76e643..b9945dc 100644 --- a/src/tap/tracker.py +++ b/src/tap/tracker.py @@ -73,7 +73,14 @@ def _track(self, class_name): if self.combined: self.combined_test_cases_seen.append(class_name) - def add_ok(self, class_name, description, directive="", diagnostics=None, raw_yaml_block=None): + def add_ok( + self, + class_name, + description, + directive="", + diagnostics=None, + raw_yaml_block=None, + ): result = Result( ok=True, number=self._get_next_line_number(class_name), @@ -84,14 +91,21 @@ def add_ok(self, class_name, description, directive="", diagnostics=None, raw_ya ) self._add_line(class_name, result) - def add_not_ok(self, class_name, description, directive="", diagnostics=None, raw_yaml_block=None): + def add_not_ok( + self, + class_name, + description, + directive="", + diagnostics=None, + raw_yaml_block=None, + ): result = Result( ok=False, number=self._get_next_line_number(class_name), description=description, diagnostics=diagnostics, directive=Directive(directive), - raw_yaml_block=raw_yaml_block + raw_yaml_block=raw_yaml_block, ) self._add_line(class_name, result) From 730e5f44973b1fa719bfc06aaf7d3ba4572a1d09 Mon Sep 17 00:00:00 2001 From: Cody D'Ambrosio Date: Thu, 4 Dec 2025 09:50:40 -0500 Subject: [PATCH 05/14] add unit tests --- tests/test_line.py | 13 +++++++++++-- tests/test_tracker.py | 18 ++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/tests/test_line.py b/tests/test_line.py index 9691533..4b3fbd9 100644 --- a/tests/test_line.py +++ b/tests/test_line.py @@ -38,5 +38,14 @@ def test_str_directive(self): self.assertEqual("ok 44 passing # SKIP a reason", str(result)) def test_str_diagnostics(self): - result = Result(False, 43, "failing", diagnostics="# more info") - self.assertEqual("not ok 43 failing\n# more info", str(result)) + result = Result(False, 45, "failing", diagnostics="# more info") + self.assertEqual("not ok 45 failing\n# more info", str(result)) + + def test_yaml_block(self): + raw_yaml_block = """\ +message: test_message +severity: fail +""" + result = Result(False, 46, "passing", None, None, + raw_yaml_block=raw_yaml_block) + self.assertEqual(result.yaml_block["message"], "test_message") diff --git a/tests/test_tracker.py b/tests/test_tracker.py index 1e1c10e..d6e396f 100644 --- a/tests/test_tracker.py +++ b/tests/test_tracker.py @@ -295,6 +295,24 @@ def test_adds_not_ok_with_diagnostics(self): line = tracker._test_cases["FakeTestCase"][0] self.assertEqual("# more info\n", line.diagnostics) + def test_adds_ok_with_yaml_block(self): + tracker = Tracker() + tracker.add_ok("FakeTestCase", "a description", raw_yaml_block="""\ +message: test_message +severity: pass +""") + line = tracker._test_cases["FakeTestCase"][0] + self.assertEqual("test_message", line.yaml_block["message"]) + + def test_adds_not_ok_with_yaml_block(self): + tracker = Tracker() + tracker.add_not_ok("FakeTestCase", "a description", raw_yaml_block="""\ +message: test_message +severity: fail +""") + line = tracker._test_cases["FakeTestCase"][0] + self.assertEqual("test_message", line.yaml_block["message"]) + def test_header_displayed_by_default(self): tracker = Tracker() self.assertTrue(tracker.header) From d352ac0a9f1ceca622794f362b76c3a619e8033d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 4 Dec 2025 14:50:54 +0000 Subject: [PATCH 06/14] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tests/test_line.py | 3 +-- tests/test_tracker.py | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/tests/test_line.py b/tests/test_line.py index 4b3fbd9..a838f1c 100644 --- a/tests/test_line.py +++ b/tests/test_line.py @@ -46,6 +46,5 @@ def test_yaml_block(self): message: test_message severity: fail """ - result = Result(False, 46, "passing", None, None, - raw_yaml_block=raw_yaml_block) + result = Result(False, 46, "passing", None, None, raw_yaml_block=raw_yaml_block) self.assertEqual(result.yaml_block["message"], "test_message") diff --git a/tests/test_tracker.py b/tests/test_tracker.py index d6e396f..fd25046 100644 --- a/tests/test_tracker.py +++ b/tests/test_tracker.py @@ -297,19 +297,27 @@ def test_adds_not_ok_with_diagnostics(self): def test_adds_ok_with_yaml_block(self): tracker = Tracker() - tracker.add_ok("FakeTestCase", "a description", raw_yaml_block="""\ + tracker.add_ok( + "FakeTestCase", + "a description", + raw_yaml_block="""\ message: test_message severity: pass -""") +""", + ) line = tracker._test_cases["FakeTestCase"][0] self.assertEqual("test_message", line.yaml_block["message"]) def test_adds_not_ok_with_yaml_block(self): tracker = Tracker() - tracker.add_not_ok("FakeTestCase", "a description", raw_yaml_block="""\ + tracker.add_not_ok( + "FakeTestCase", + "a description", + raw_yaml_block="""\ message: test_message severity: fail -""") +""", + ) line = tracker._test_cases["FakeTestCase"][0] self.assertEqual("test_message", line.yaml_block["message"]) From e87aa3b45e8d83d0fad353fc8726e5386dfd5211 Mon Sep 17 00:00:00 2001 From: Cody D'Ambrosio Date: Thu, 4 Dec 2025 09:55:55 -0500 Subject: [PATCH 07/14] add mocks --- tests/test_line.py | 1 + tests/test_tracker.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/tests/test_line.py b/tests/test_line.py index 4b3fbd9..f76c08f 100644 --- a/tests/test_line.py +++ b/tests/test_line.py @@ -41,6 +41,7 @@ def test_str_diagnostics(self): result = Result(False, 45, "failing", diagnostics="# more info") self.assertEqual("not ok 45 failing\n# more info", str(result)) + @unittest.mock.patch("tap.line.LOAD_YAML", True) def test_yaml_block(self): raw_yaml_block = """\ message: test_message diff --git a/tests/test_tracker.py b/tests/test_tracker.py index d6e396f..f256b42 100644 --- a/tests/test_tracker.py +++ b/tests/test_tracker.py @@ -295,6 +295,8 @@ def test_adds_not_ok_with_diagnostics(self): line = tracker._test_cases["FakeTestCase"][0] self.assertEqual("# more info\n", line.diagnostics) + @mock.patch("tap.tracker.ENABLE_VERSION_13", True) + @mock.patch("tap.line.LOAD_YAML", True) def test_adds_ok_with_yaml_block(self): tracker = Tracker() tracker.add_ok("FakeTestCase", "a description", raw_yaml_block="""\ @@ -304,6 +306,8 @@ def test_adds_ok_with_yaml_block(self): line = tracker._test_cases["FakeTestCase"][0] self.assertEqual("test_message", line.yaml_block["message"]) + @mock.patch("tap.tracker.ENABLE_VERSION_13", True) + @mock.patch("tap.line.LOAD_YAML", True) def test_adds_not_ok_with_yaml_block(self): tracker = Tracker() tracker.add_not_ok("FakeTestCase", "a description", raw_yaml_block="""\ From 9280bfb7451eaed5cea0b1f45ac870a4ff90a7c4 Mon Sep 17 00:00:00 2001 From: Cody D'Ambrosio Date: Thu, 4 Dec 2025 10:04:52 -0500 Subject: [PATCH 08/14] fix unittests --- tests/test_line.py | 14 ++++++++++++-- tests/test_tracker.py | 22 ++++++++++++++++------ 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/tests/test_line.py b/tests/test_line.py index 7a5056c..f5f7f11 100644 --- a/tests/test_line.py +++ b/tests/test_line.py @@ -3,6 +3,14 @@ from tap.directive import Directive from tap.line import Line, Result +try: + import yaml + from more_itertools import peekable # noqa + + have_yaml = True +except ImportError: + have_yaml = False + class TestLine(unittest.TestCase): """Tests for tap.line.Line""" @@ -41,11 +49,13 @@ def test_str_diagnostics(self): result = Result(False, 45, "failing", diagnostics="# more info") self.assertEqual("not ok 45 failing\n# more info", str(result)) - @unittest.mock.patch("tap.line.LOAD_YAML", True) def test_yaml_block(self): raw_yaml_block = """\ message: test_message severity: fail """ result = Result(False, 46, "passing", None, None, raw_yaml_block=raw_yaml_block) - self.assertEqual(result.yaml_block["message"], "test_message") + if have_yaml: + self.assertEqual(result.yaml_block["message"], "test_message") + else: + self.assertIsNone(result.yaml_block) diff --git a/tests/test_tracker.py b/tests/test_tracker.py index 61c17f7..34eb397 100644 --- a/tests/test_tracker.py +++ b/tests/test_tracker.py @@ -7,6 +7,14 @@ from tap.tests import TestCase from tap.tracker import Tracker +try: + import yaml + from more_itertools import peekable # noqa + + have_yaml = True +except ImportError: + have_yaml = False + class TestTracker(TestCase): def _make_header(self, test_case): @@ -295,8 +303,6 @@ def test_adds_not_ok_with_diagnostics(self): line = tracker._test_cases["FakeTestCase"][0] self.assertEqual("# more info\n", line.diagnostics) - @mock.patch("tap.tracker.ENABLE_VERSION_13", True) - @mock.patch("tap.line.LOAD_YAML", True) def test_adds_ok_with_yaml_block(self): tracker = Tracker() tracker.add_ok( @@ -308,10 +314,11 @@ def test_adds_ok_with_yaml_block(self): """, ) line = tracker._test_cases["FakeTestCase"][0] - self.assertEqual("test_message", line.yaml_block["message"]) + if have_yaml: + self.assertEqual("test_message", line.yaml_block["message"]) + else: + self.assertIsNone(line.yaml_block) - @mock.patch("tap.tracker.ENABLE_VERSION_13", True) - @mock.patch("tap.line.LOAD_YAML", True) def test_adds_not_ok_with_yaml_block(self): tracker = Tracker() tracker.add_not_ok( @@ -323,7 +330,10 @@ def test_adds_not_ok_with_yaml_block(self): """, ) line = tracker._test_cases["FakeTestCase"][0] - self.assertEqual("test_message", line.yaml_block["message"]) + if have_yaml: + self.assertEqual("test_message", line.yaml_block["message"]) + else: + self.assertIsNone(line.yaml_block) def test_header_displayed_by_default(self): tracker = Tracker() From 88ee20f92b7edd843234f0932ec960e32cc90756 Mon Sep 17 00:00:00 2001 From: Cody D'Ambrosio Date: Thu, 4 Dec 2025 10:21:44 -0500 Subject: [PATCH 09/14] Update test_line.py --- tests/test_line.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_line.py b/tests/test_line.py index f5f7f11..db7131b 100644 --- a/tests/test_line.py +++ b/tests/test_line.py @@ -54,8 +54,9 @@ def test_yaml_block(self): message: test_message severity: fail """ - result = Result(False, 46, "passing", None, None, raw_yaml_block=raw_yaml_block) + result = Result(False, 46, "passing", raw_yaml_block=raw_yaml_block) if have_yaml: self.assertEqual(result.yaml_block["message"], "test_message") + self.assertIn(str(result), " ---\n message: test_message\n severity: fail\n ...") else: self.assertIsNone(result.yaml_block) From fc0c0453e62aed0ec7fc6c6a67037888e89745bd Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 4 Dec 2025 15:21:51 +0000 Subject: [PATCH 10/14] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tests/test_line.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_line.py b/tests/test_line.py index db7131b..f835625 100644 --- a/tests/test_line.py +++ b/tests/test_line.py @@ -57,6 +57,8 @@ def test_yaml_block(self): result = Result(False, 46, "passing", raw_yaml_block=raw_yaml_block) if have_yaml: self.assertEqual(result.yaml_block["message"], "test_message") - self.assertIn(str(result), " ---\n message: test_message\n severity: fail\n ...") + self.assertIn( + str(result), " ---\n message: test_message\n severity: fail\n ..." + ) else: self.assertIsNone(result.yaml_block) From f76011c34cc1e750a5458705674dc64d77d539da Mon Sep 17 00:00:00 2001 From: Cody D'Ambrosio Date: Thu, 4 Dec 2025 10:26:04 -0500 Subject: [PATCH 11/14] fix formatting and test --- src/tap/line.py | 3 ++- tests/test_line.py | 4 ++-- tests/test_tracker.py | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/tap/line.py b/src/tap/line.py index cdacbc1..ee6a1dc 100644 --- a/src/tap/line.py +++ b/src/tap/line.py @@ -118,7 +118,8 @@ def __str__(self): f"{indent}{line}" for line in self._yaml_block.splitlines() ) yaml_block = f"\n{indent}---\n{indented_yaml_block}\n{indent}..." - return f"{is_not}ok {self.number} {self.description}{directive}{diagnostics}{yaml_block}" + return (f"{is_not}ok {self.number} {self.description}{directive}" + f"{diagnostics}{yaml_block}") class Plan(Line): diff --git a/tests/test_line.py b/tests/test_line.py index db7131b..5010832 100644 --- a/tests/test_line.py +++ b/tests/test_line.py @@ -4,7 +4,7 @@ from tap.line import Line, Result try: - import yaml + import yaml # noqa from more_itertools import peekable # noqa have_yaml = True @@ -57,6 +57,6 @@ def test_yaml_block(self): result = Result(False, 46, "passing", raw_yaml_block=raw_yaml_block) if have_yaml: self.assertEqual(result.yaml_block["message"], "test_message") - self.assertIn(str(result), " ---\n message: test_message\n severity: fail\n ...") + self.assertIn(" ---\n message: test_message\n severity: fail\n ...", str(result)) else: self.assertIsNone(result.yaml_block) diff --git a/tests/test_tracker.py b/tests/test_tracker.py index 34eb397..0ad6b01 100644 --- a/tests/test_tracker.py +++ b/tests/test_tracker.py @@ -8,7 +8,7 @@ from tap.tracker import Tracker try: - import yaml + import yaml # noqa from more_itertools import peekable # noqa have_yaml = True From 9b8cecba19dcc37dba0166e3131fa6a0dc39511c Mon Sep 17 00:00:00 2001 From: Cody D'Ambrosio Date: Thu, 4 Dec 2025 10:27:22 -0500 Subject: [PATCH 12/14] Update test_line.py --- tests/test_line.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_line.py b/tests/test_line.py index 995a61a..fe855f9 100644 --- a/tests/test_line.py +++ b/tests/test_line.py @@ -58,7 +58,7 @@ def test_yaml_block(self): if have_yaml: self.assertEqual(result.yaml_block["message"], "test_message") self.assertIn( - str(result), " ---\n message: test_message\n severity: fail\n ..." + " ---\n message: test_message\n severity: fail\n ...", str(result) ) else: self.assertIsNone(result.yaml_block) From 88cb8b88f94dc65439665595078ec209e98c956c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 4 Dec 2025 15:27:29 +0000 Subject: [PATCH 13/14] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/tap/line.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tap/line.py b/src/tap/line.py index ee6a1dc..6295d7a 100644 --- a/src/tap/line.py +++ b/src/tap/line.py @@ -118,8 +118,10 @@ def __str__(self): f"{indent}{line}" for line in self._yaml_block.splitlines() ) yaml_block = f"\n{indent}---\n{indented_yaml_block}\n{indent}..." - return (f"{is_not}ok {self.number} {self.description}{directive}" - f"{diagnostics}{yaml_block}") + return ( + f"{is_not}ok {self.number} {self.description}{directive}" + f"{diagnostics}{yaml_block}" + ) class Plan(Line): From 579effb7a4c53e9954ea810021162f9ca200fdf5 Mon Sep 17 00:00:00 2001 From: Cody D'Ambrosio Date: Fri, 12 Dec 2025 08:56:56 -0500 Subject: [PATCH 14/14] remove indent variable --- src/tap/line.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/tap/line.py b/src/tap/line.py index 6295d7a..646cf1e 100644 --- a/src/tap/line.py +++ b/src/tap/line.py @@ -113,11 +113,10 @@ def __str__(self): diagnostics = "\n" + self.diagnostics.rstrip() yaml_block = "" if self._yaml_block is not None: - indent = " " indented_yaml_block = "\n".join( - f"{indent}{line}" for line in self._yaml_block.splitlines() + f" {line}" for line in self._yaml_block.splitlines() ) - yaml_block = f"\n{indent}---\n{indented_yaml_block}\n{indent}..." + yaml_block = f"\n ---\n{indented_yaml_block}\n ..." return ( f"{is_not}ok {self.number} {self.description}{directive}" f"{diagnostics}{yaml_block}"