run_checks: Show coverage percentage.
This commit is contained in:
parent
4fa5872733
commit
b61f8941de
@ -32,6 +32,7 @@ Module attributes:
|
|||||||
import sys
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
import os
|
import os
|
||||||
|
import io
|
||||||
import os.path
|
import os.path
|
||||||
import unittest
|
import unittest
|
||||||
import logging
|
import logging
|
||||||
@ -165,6 +166,8 @@ def check_unittest(run_coverage):
|
|||||||
result = unittest.TextTestRunner().run(suite)
|
result = unittest.TextTestRunner().run(suite)
|
||||||
if run_coverage:
|
if run_coverage:
|
||||||
cov.stop()
|
cov.stop()
|
||||||
|
perc = cov.report(file=io.StringIO())
|
||||||
|
print("COVERAGE: {}%".format(round(perc)))
|
||||||
cov.html_report()
|
cov.html_report()
|
||||||
print()
|
print()
|
||||||
return result.wasSuccessful()
|
return result.wasSuccessful()
|
||||||
|
Loading…
Reference in New Issue
Block a user