From 58a357a429738bcea9929f5b81f336b062e0cf0c Mon Sep 17 00:00:00 2001 From: Darren Burns Date: Mon, 21 Oct 2019 23:49:29 +0100 Subject: [PATCH] Outputting fixtures on test failure if present --- ward/terminal.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ward/terminal.py b/ward/terminal.py index b54cbcb1..1848fd90 100644 --- a/ward/terminal.py +++ b/ward/terminal.py @@ -122,7 +122,18 @@ def output_single_test_result(self, test_result: TestResult): print(colored(padded_outcome, color="grey", on_color=bg), mod_name + test_result.test.name) def output_why_test_failed_header(self, test_result: TestResult): - print(colored(" Failure", color="red"), "in", colored(test_result.test.qualified_name, attrs=["bold"]), "\n") + params_list = ", ".join(lightblack(str(v)) for v in test_result.test.deps().keys()) + if test_result.test.has_deps(): + test_name_suffix = f"({params_list})" + else: + test_name_suffix = "" + print( + colored(" Failure", color="red"), + "in", + colored(test_result.test.qualified_name, attrs=["bold"]), + test_name_suffix, + "\n", + ) def output_why_test_failed(self, test_result: TestResult): err = test_result.error