Fix ansible-test handling of no Python coverage.

This commit is contained in:
Matt Clay 2020-03-06 15:14:59 -08:00 committed by Matt Martz
parent 99e136e153
commit 50442f9fdd
2 changed files with 7 additions and 2 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- ansible-test no longer errors reporting coverage when no Python coverage exists. This fixes issues reporting on PowerShell only coverage from collections.

View file

@ -110,8 +110,11 @@ def _command_coverage_combine_python(args):
if not args.explain: if not args.explain:
output_file = coverage_file + group output_file = coverage_file + group
updated.write_file(output_file) updated.write_file(output_file) # always write files to make sure stale files do not exist
output_files.append(output_file)
if updated:
# only report files which are non-empty to prevent coverage from reporting errors
output_files.append(output_file)
path_checker.report() path_checker.report()