Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.

Commit a74ce80

Browse files
authored
Remove usage of additional Report.get arguments (#1210)
1 parent 8d9cd04 commit a74ce80

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

graphql_api/tests/test_commit.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def __init__(self):
9090

9191

9292
class MockReport(object):
93-
def get(self, file, _else):
93+
def get(self, filename):
9494
MockLines()
9595
return MockLines()
9696

@@ -102,7 +102,7 @@ def get_flag_names(self):
102102

103103

104104
class EmptyReport(MockReport):
105-
def get(self, file, _else):
105+
def get(self, filename):
106106
return None
107107

108108

graphql_api/types/commit/commit.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ def resolve_coverage_flags(commit: Commit, info: GraphQLResolveInfo) -> list[str
333333
@commit_coverage_analytics_bindable.field("coverageFile")
334334
@sync_to_async
335335
def resolve_coverage_file(commit, info, path, flags=None, components=None):
336-
_else, paths = None, []
336+
fallback_file, paths = None, []
337337
if components:
338338
all_components = components_service.commit_components(
339339
commit, info.context["request"].current_owner
@@ -343,10 +343,10 @@ def resolve_coverage_file(commit, info, path, flags=None, components=None):
343343
)
344344
for fc in filtered_components:
345345
paths.extend(fc.paths)
346-
_else = FilteredReportFile(ReportFile(path), [])
346+
fallback_file = FilteredReportFile(ReportFile(path), [])
347347

348348
commit_report = commit.full_report.filter(flags=flags, paths=paths)
349-
file_report = commit_report.get(path, _else=_else)
349+
file_report = commit_report.get(path) or fallback_file
350350

351351
return {
352352
"commit_report": commit_report,

0 commit comments

Comments
 (0)