From 8136856ef5da9c61d9cd070813269ed00baa59e2 Mon Sep 17 00:00:00 2001 From: James Baber <67345633+james-baber@users.noreply.github.com> Date: Thu, 7 Oct 2021 20:26:37 -0500 Subject: [PATCH 1/4] Reverted getDescription updated so that getDescription now looks at the doc string first, otherwise it uses the test name --- HtmlTestRunner/result.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/HtmlTestRunner/result.py b/HtmlTestRunner/result.py index 96fb431..cab7235 100644 --- a/HtmlTestRunner/result.py +++ b/HtmlTestRunner/result.py @@ -164,8 +164,12 @@ def callback(): self.callback = callback def getDescription(self, test): - """ Return the test description if not have test name. """ - return str(test) + """ Return the test description if it has one, otherwise return the test name. """ + doc_first_line = test.shortDescription() + if self.descriptions and doc_first_line: + return doc_first_line + else: + return str(test) def startTest(self, test): """ Called before execute each method. """ From 8c7a2b414756ce0e08627870ad2806372f6f109f Mon Sep 17 00:00:00 2001 From: James Baber <67345633+james-baber@users.noreply.github.com> Date: Thu, 7 Oct 2021 20:30:13 -0500 Subject: [PATCH 2/4] Default template uses description Use the description as in the default template --- HtmlTestRunner/template/report_template.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/HtmlTestRunner/template/report_template.html b/HtmlTestRunner/template/report_template.html index 4c2256b..94ff315 100644 --- a/HtmlTestRunner/template/report_template.html +++ b/HtmlTestRunner/template/report_template.html @@ -32,7 +32,7 @@