Optimize coverage script/settings

This commit is contained in:
Daniil Fajnberg 2022-04-06 21:47:39 +02:00
parent cf02206588
commit 3a8fcb2d5a
Signed by: daniil-berg
GPG Key ID: BE187C50903BEE97
2 changed files with 9 additions and 10 deletions

View File

@ -1,8 +1,7 @@
[run]
source = src/
branch = true
omit =
.venv/*
command_line = -m unittest discover
[report]
fail_under = 100
@ -11,5 +10,4 @@ skip_covered = False
exclude_lines =
if TYPE_CHECKING:
if __name__ == ['"]__main__['"]:
omit =
tests/*
if sys.version_info.+:

View File

@ -12,13 +12,14 @@
# You should have received a copy of the GNU Lesser General Public License along with asyncio-taskpool.
# If not, see <https://www.gnu.org/licenses/>.
coverage erase && coverage run -m unittest discover 2> /dev/null
coverage erase
coverage run 2> /dev/null
typeset total
total=$(coverage report | awk '$1 == "TOTAL" {print $NF}')
typeset report=$(coverage report)
typeset total=$(echo "${report}" | awk '$1 == "TOTAL" {print $NF; exit}')
if [[ $total == 100% ]]; then
echo $total
if [[ ${total} == 100% ]]; then
echo ${total}
else
coverage report
echo "${report}"
fi