diff --git a/HtmlTestRunner/result.py b/HtmlTestRunner/result.py index 96fb431..b848e91 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 '' def startTest(self, test): """ Called before execute each method. """ diff --git a/HtmlTestRunner/template/report_template.html b/HtmlTestRunner/template/report_template.html index 4c2256b..0ef4276 100644 --- a/HtmlTestRunner/template/report_template.html +++ b/HtmlTestRunner/template/report_template.html @@ -32,7 +32,7 @@