Bento4/tasks/test.py
Gilles Boccon-Gibod 628b31d7eb wip
2020-02-29 12:34:56 -08:00

13 lines
481 B
Python

from invoke import task, Collection
@task(help = {
'coverage': "Enable code coverage analysis"
}, default = True)
def run(ctx, coverage=False):
command = "python3 -m pytest Test/Pytest"
if coverage:
command = "coverage3 run --source=Source/Python/utils -m pytest Test/Pytest"
ctx.run(command, env={'PYTHONPATH': 'Source/Python/utils', 'BENTO4_HOME': os.path.abspath(os.path.curdir)})
if coverage:
ctx.run("coverage3 html -d coverage_html")