tools: Show error message when python-coverage sees old .coverage.
This commit is contained in:
parent
bea859f54f
commit
b3dbcddcf6
1 changed files with 5 additions and 2 deletions
|
|
@ -324,8 +324,11 @@ def python_coverage(path):
|
|||
' file was generated.')
|
||||
path = os.path.normpath(path)
|
||||
with tempfile.TemporaryDirectory() as temp_dir:
|
||||
_do_command([PYTHON_EXECUTABLE, "-m", "coverage",
|
||||
stdout, stderr, returncode = _do_command(
|
||||
[PYTHON_EXECUTABLE, "-m", "coverage",
|
||||
"annotate", "--directory", temp_dir, path])
|
||||
if returncode != 0:
|
||||
return Status.problem, stdout
|
||||
cover_filename = path.replace("/", "_") + ",cover"
|
||||
with open(os.path.join(temp_dir, cover_filename), "r") as f:
|
||||
lines = f.read().splitlines(keepends=True)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue