Skip to content

Commit

Permalink
Fix some coverage gaps
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Betts committed May 4, 2023
1 parent a993b5f commit c124650
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ omit =
[report]
show_missing = True
precision = 2
fail_under = 98.26
fail_under = 98.27
skip_covered = True
6 changes: 2 additions & 4 deletions h/services/annotation_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,12 @@ def get_annotations_by_id(

@staticmethod
def _annotation_search_query(
ids: Optional[List[str]] = None, eager_load: Optional[List] = None
ids: List[str] = None, eager_load: Optional[List] = None
) -> Query:
"""Create a query for searching for annotations."""

query = select(Annotation)

if ids:
query = query.where(Annotation.id.in_(ids))
query = query.where(Annotation.id.in_(ids))

if eager_load:
query = query.options(*(subqueryload(prop) for prop in eager_load))
Expand Down
12 changes: 6 additions & 6 deletions tests/h/activity/query_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,12 +389,12 @@ def test_it_returns_each_annotation_presented(self, annotations, pyramid_request
for bucket in timeframe.document_buckets.values():
presented_annotations.extend(bucket.presented_annotations)

for annotation in annotations:
for presented_annotation in presented_annotations:
if presented_annotation["annotation"].annotation == annotation:
break
else:
assert False
assert set(annotations).intersection(
{
presented_anno["annotation"].annotation
for presented_anno in presented_annotations
}
)

def test_it_returns_each_annotations_group(self, _fetch_groups, pyramid_request):
result = execute(pyramid_request, MultiDict(), self.PAGE_SIZE)
Expand Down

0 comments on commit c124650

Please sign in to comment.