diff --git a/9pm.py b/9pm.py index aa7faea..5d34ebe 100755 --- a/9pm.py +++ b/9pm.py @@ -586,11 +586,12 @@ def agent_prompt(data, aborted): called = "called without arguments" lines.append(wrap(f"\"{test['name']}\" at \"{proj_relpath(test['case'])}\" " f"{called} failed with:")) + lines.append("```") for failure in test['failures']: - lines.extend(f" {line}" for line in failure) + lines.extend(failure) if len(failure) >= 40: - lines.append(" (more in the log)") - lines.append("") + lines.append("(more in the log)") + lines += ["```", ""] lines.append("Please help me investigate this.") if PROJECT.get('AGENT-HINTS'): diff --git a/self_test/run.py b/self_test/run.py index ae6509a..e3fbb5b 100755 --- a/self_test/run.py +++ b/self_test/run.py @@ -332,7 +332,7 @@ def test_agent_prompt(self): for expected in [ '1 test failed running "self_test/suites/abort-suite.yaml" in project 9pm (git ', '"fail.sh" at "self_test/cases/fail.sh" called with arguments \'opt1\' failed with:', - " not ok 1 - Dummy test fail", + "failed with: ``` not ok 1 - Dummy test fail ```", "The run was aborted at the first fatal failure.", "Please help me investigate this.", ]: