Skip to content

Commit 65d44b0

Browse files
committed
python: report partial lines
1 parent 1d00828 commit 65d44b0

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

autoload/coverage/python.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ function! coverage#python#GetCoveragePyProvider() abort
5656
\ 'vim_coverage.GetCoveragePyLines(%s, %s)',
5757
\ string(l:cov_file),
5858
\ string(a:filename)))
59-
let [l:covered_lines, l:uncovered_lines] = l:coverage_data
60-
return coverage#CreateReport(l:covered_lines, l:uncovered_lines, [])
59+
let [l:covered_lines, l:uncovered_lines, l:partial_lines] = l:coverage_data
60+
return coverage#CreateReport(l:covered_lines, l:uncovered_lines, l:partial_lines)
6161
endfunction
6262

6363
return l:provider

python/vim_coverage.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020

2121
def GetCoveragePyLines(path, source_file):
22-
"""Get (covered, uncovered) lines for source_file from .coverage file at path.
22+
"""Get (covered, uncovered, partial) lines for source_file from .coverage file at path.
2323
"""
2424
prev_cwd = os.getcwd()
2525
source_file = os.path.abspath(source_file)
@@ -39,4 +39,8 @@ def GetCoveragePyLines(path, source_file):
3939
except TypeError:
4040
covered_lines = cov.data.line_data()[source_file]
4141
uncovered_lines = cov.analysis(source_file)[2]
42-
return (covered_lines, uncovered_lines)
42+
43+
analysis = cov._analyze(source_file)
44+
partial = list(analysis.missing_branch_arcs().keys())
45+
46+
return (covered_lines, uncovered_lines, partial)

0 commit comments

Comments
 (0)