Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(deps): add support for coverage v7.5+ #442

Merged
merged 1 commit into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions coveralls/reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,15 @@ def get_arcs(analysis: Analysis) -> List[int]:
3. branch-number
4. hits (we only get 1/0 from coverage.py)
"""
if not analysis.has_arcs():
# pylint: disable=too-complex
has_arcs: bool
try:
has_arcs = analysis.has_arcs()
except TypeError:
# coverage v7.5+
has_arcs = analysis.has_arcs

if not has_arcs:
return []

missing_arcs: Dict[int, List[int]] = analysis.missing_branch_arcs()
Expand Down Expand Up @@ -120,17 +128,15 @@ def parse_file(self, cu: FileReporter, analysis: Analysis) -> None:
posix_filename = posix_filename[len(self.base_dir):]
posix_filename = self.src_dir + posix_filename

source = analysis.file_reporter.source()

token_lines = analysis.file_reporter.source_token_lines()
token_lines = cu.source_token_lines()
coverage_lines = [
self.get_hits(i, analysis)
for i, _ in enumerate(token_lines, 1)
]

results = {
'name': posix_filename,
'source': source,
'source': cu.source(),
'coverage': coverage_lines,
}

Expand Down
Loading
Loading