Skip to content

Commit

Permalink
tests: restore 100% coverage (#234)
Browse files Browse the repository at this point in the history
- Ignore 'DistributionNotFound' fallbacks (only in setuptools-less installs).
- Drop unused helper (fossil from PR #225).

release-as: 2.0.0-dev2
  • Loading branch information
tseaver committed Oct 26, 2020
1 parent b1fd123 commit ffd1ac1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ exclude_lines =
def __repr__
# Ignore abstract methods
raise NotImplementedError
# Ignore setuptools-less fallback
except pkg_resources.DistributionNotFound:
omit =
*/gapic/*.py
*/proto/*.py
Expand Down
11 changes: 0 additions & 11 deletions google/cloud/firestore_v1/base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,17 +536,6 @@ def _get_doc_mask(field_paths: Iterable[str]) -> Optional[types.common.DocumentM
return types.DocumentMask(field_paths=field_paths)


def _item_to_collection_ref(iterator, item: str) -> BaseCollectionReference:
"""Convert collection ID to collection ref.
Args:
iterator (google.api_core.page_iterator.GRPCIterator):
iterator response
item (str): ID of the collection
"""
return iterator.client.collection(item)


def _path_helper(path: tuple) -> Tuple[str]:
"""Standardize path into a tuple of path segments.
Expand Down
14 changes: 14 additions & 0 deletions synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,20 @@ def lint_setup_py(session):
""",
)

s.replace(
".coveragerc",
"""\
raise NotImplementedError
omit =
""",
"""\
raise NotImplementedError
# Ignore setuptools-less fallback
except pkg_resources.DistributionNotFound:
omit =
""",
)

s.shell.run(["nox", "-s", "blacken"], hide_output=False)

s.replace(
Expand Down

0 comments on commit ffd1ac1

Please sign in to comment.