ansible-test - Fix Python coverage stub generation (#81611)

As of coverage 7.1.0, files without arcs are not generated.

To work around this, an empty (0, 0) arc is used for each file instead.

This is a follow-up to https://github.com/ansible/ansible/pull/81077

ci_coverage
ci_complete
pull/81614/head
Matt Clay 9 months ago committed by GitHub
parent ae69b280ad
commit 5a059b81c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -121,7 +121,7 @@ def _command_coverage_combine_python(args: CoverageCombineConfig, host_state: Ho
coverage_files = get_python_coverage_files()
def _default_stub_value(source_paths: list[str]) -> dict[str, set[tuple[int, int]]]:
return {path: set() for path in source_paths}
return {path: {(0, 0)} for path in source_paths}
counter = 0
sources = _get_coverage_targets(args, walk_compile_targets)

Loading…
Cancel
Save