Fixed a bug in the python3-coverage tool.

This commit is contained in:
Andrew Hamilton 2016-02-04 19:47:52 +00:00
parent 56e7cf1147
commit 33f75aefae
2 changed files with 6 additions and 5 deletions

2
BUGS
View file

@ -3,7 +3,6 @@ Current
Current (tool related)
- python-coverage is failing in the sub-directories of a project.
- disassemble for python doesn't always work.
- gut had an error with utf-8. A traceback printed directly on the screen,
garbling the interface.
@ -213,6 +212,7 @@ Fixed
- Scrolling in the help screen doesn't work with the arrow keys.
- If vigil is started with eveything up-to-date the up-to-date message never
appears.
- python-coverage is failing in the sub-directories of a project.
Won't fix

View file

@ -316,10 +316,11 @@ def python_coverage(path):
env["COVERAGE_FILE"] = coverage_path
stdout, *rest = _do_command(
[python_exe, "run", test_path], env=env, timeout=TIMEOUT)
stdout, *rest = _do_command(
[python_exe, "annotate", "--directory", temp_dir,
os.path.normpath(path)], env=env)
with open(os.path.join(temp_dir, path + ",cover"), "r") as f:
path = os.path.normpath(path)
stdout, *rest = _do_command([python_exe, "annotate", "--directory",
temp_dir, path], env=env)
flat_path = path.replace("/", "_")
with open(os.path.join(temp_dir, flat_path + ",cover"), "r") as f:
stdout = f.read()
return Status.normal, fill3.Text(_colorize_coverage_report(stdout))
else: