diff --git a/spin/cmds/meson.py b/spin/cmds/meson.py index adb8f47..350423c 100644 --- a/spin/cmds/meson.py +++ b/spin/cmds/meson.py @@ -168,7 +168,7 @@ def _get_configured_command(command_name): @click.option( "--coverage", is_flag=True, - help="Report coverage of project code. HTML output goes under build/coverage", + help="Generate coverage report of executed tests. HTML output goes under `build/coverage`.", ) @click.pass_context def test(ctx, pytest_args, coverage=False): @@ -243,12 +243,11 @@ def test(ctx, pytest_args, coverage=False): if coverage: coverage_dir = os.path.join(os.getcwd(), "build/coverage/") - print(f"Removing `{coverage_dir}`") if os.path.isdir(coverage_dir): + print(f"Removing `{coverage_dir}`") shutil.rmtree(coverage_dir) os.makedirs(coverage_dir) - pytest_args = [ - *pytest_args, + pytest_args = pytest_args + [ f"--cov-report=html:{coverage_dir}", f"--cov={package}", ]