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,11 +273,11 @@ class TestSuite():
|
||||||
|
|
||||||
reports += list(test(self))
|
reports += list(test(self))
|
||||||
|
|
||||||
|
# Display part
|
||||||
|
|
||||||
def report_type(report):
|
def report_type(report):
|
||||||
return report.__class__.__name__.lower()
|
return report.__class__.__name__.lower()
|
||||||
|
|
||||||
if output == "plain":
|
|
||||||
|
|
||||||
if any(report_type(r) in ["warning", "error", "critical"] for r in reports):
|
if any(report_type(r) in ["warning", "error", "critical"] for r in reports):
|
||||||
prefix = c.WARNING + '! '
|
prefix = c.WARNING + '! '
|
||||||
elif any(report_type(r) in ["info"] for r in reports):
|
elif any(report_type(r) in ["info"] for r in reports):
|
||||||
|
@ -296,7 +296,6 @@ class TestSuite():
|
||||||
if len(reports):
|
if len(reports):
|
||||||
_print("")
|
_print("")
|
||||||
|
|
||||||
else:
|
|
||||||
for report in reports:
|
for report in reports:
|
||||||
test_name = test.__qualname__
|
test_name = test.__qualname__
|
||||||
tests_reports[report_type(report)].append((test_name, report))
|
tests_reports[report_type(report)].append((test_name, report))
|
||||||
|
@ -306,13 +305,11 @@ class TestSuite():
|
||||||
|
|
||||||
reports = list(test(self))
|
reports = list(test(self))
|
||||||
|
|
||||||
if output == "plain":
|
|
||||||
for report in reports:
|
|
||||||
report.display()
|
|
||||||
else:
|
|
||||||
def report_type(report):
|
def report_type(report):
|
||||||
return report.__class__.__name__.lower()
|
return report.__class__.__name__.lower()
|
||||||
|
|
||||||
for report in reports:
|
for report in reports:
|
||||||
|
report.display()
|
||||||
test_name = test.__qualname__
|
test_name = test.__qualname__
|
||||||
tests_reports[report_type(report)].append((test_name, report))
|
tests_reports[report_type(report)].append((test_name, report))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue