mirror of
https://github.com/YunoHost/package_linter.git
synced 2024-09-03 20:06:12 +02:00
No need to differentiate if output == plain, _print handle this, we shoudl always add stuff to tests_reports
This commit is contained in:
parent
0c13d92b6d
commit
12117dad7d
1 changed files with 29 additions and 32 deletions
|
@ -273,48 +273,45 @@ class TestSuite():
|
|||
|
||||
reports += list(test(self))
|
||||
|
||||
# Display part
|
||||
|
||||
def report_type(report):
|
||||
return report.__class__.__name__.lower()
|
||||
|
||||
if output == "plain":
|
||||
|
||||
if any(report_type(r) in ["warning", "error", "critical"] for r in reports):
|
||||
prefix = c.WARNING + '! '
|
||||
elif any(report_type(r) in ["info"] for r in reports):
|
||||
prefix = 'ⓘ '
|
||||
else:
|
||||
prefix = c.OKGREEN + '✔ '
|
||||
|
||||
_print(" " + c.BOLD + prefix + c.OKBLUE + self.test_suite_name + c.END)
|
||||
|
||||
if len(reports):
|
||||
_print("")
|
||||
|
||||
for report in reports:
|
||||
report.display(prefix=" ")
|
||||
|
||||
if len(reports):
|
||||
_print("")
|
||||
|
||||
if any(report_type(r) in ["warning", "error", "critical"] for r in reports):
|
||||
prefix = c.WARNING + '! '
|
||||
elif any(report_type(r) in ["info"] for r in reports):
|
||||
prefix = 'ⓘ '
|
||||
else:
|
||||
for report in reports:
|
||||
test_name = test.__qualname__
|
||||
tests_reports[report_type(report)].append((test_name, report))
|
||||
prefix = c.OKGREEN + '✔ '
|
||||
|
||||
_print(" " + c.BOLD + prefix + c.OKBLUE + self.test_suite_name + c.END)
|
||||
|
||||
if len(reports):
|
||||
_print("")
|
||||
|
||||
for report in reports:
|
||||
report.display(prefix=" ")
|
||||
|
||||
if len(reports):
|
||||
_print("")
|
||||
|
||||
for report in reports:
|
||||
test_name = test.__qualname__
|
||||
tests_reports[report_type(report)].append((test_name, report))
|
||||
|
||||
|
||||
def run_single_test(self, test):
|
||||
|
||||
reports = list(test(self))
|
||||
|
||||
if output == "plain":
|
||||
for report in reports:
|
||||
report.display()
|
||||
else:
|
||||
def report_type(report):
|
||||
return report.__class__.__name__.lower()
|
||||
for report in reports:
|
||||
test_name = test.__qualname__
|
||||
tests_reports[report_type(report)].append((test_name, report))
|
||||
def report_type(report):
|
||||
return report.__class__.__name__.lower()
|
||||
|
||||
for report in reports:
|
||||
report.display()
|
||||
test_name = test.__qualname__
|
||||
tests_reports[report_type(report)].append((test_name, report))
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue