run_checks: Show coverage percentage.

This commit is contained in:
Florian Bruhin 2015-03-04 23:16:24 +01:00
parent 4fa5872733
commit b61f8941de

View File

@ -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()