Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Commit

Permalink
Outputting fixtures on test failure if present
Browse files Browse the repository at this point in the history
  • Loading branch information
Darren Burns committed Oct 21, 2019
1 parent 0fd1eb5 commit 58a357a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion ward/terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 58a357a

Please sign in to comment.