Skip to content

Commit afd164f

Browse files
committed
tests: restore 100% coverage
- Ignore 'DistributionNotFound' fallbacks (only in setuptools-less installs). - Drop unused helper (fossil from PR #225).
1 parent 5fb02e9 commit afd164f

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

.coveragerc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ exclude_lines =
3030
def __repr__
3131
# Ignore abstract methods
3232
raise NotImplementedError
33+
# Ignore setuptools-less fallback
34+
except pkg_resources.DistributionNotFound:
3335
omit =
3436
*/gapic/*.py
3537
*/proto/*.py

google/cloud/firestore_v1/base_client.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -536,17 +536,6 @@ def _get_doc_mask(field_paths: Iterable[str]) -> Optional[types.common.DocumentM
536536
return types.DocumentMask(field_paths=field_paths)
537537

538538

539-
def _item_to_collection_ref(iterator, item: str) -> BaseCollectionReference:
540-
"""Convert collection ID to collection ref.
541-
542-
Args:
543-
iterator (google.api_core.page_iterator.GRPCIterator):
544-
iterator response
545-
item (str): ID of the collection
546-
"""
547-
return iterator.client.collection(item)
548-
549-
550539
def _path_helper(path: tuple) -> Tuple[str]:
551540
"""Standardize path into a tuple of path segments.
552541

synth.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,20 @@ def lint_setup_py(session):
191191
""",
192192
)
193193

194+
s.replace(
195+
".coveragerc",
196+
"""\
197+
raise NotImplementedError
198+
omit =
199+
""",
200+
"""\
201+
raise NotImplementedError
202+
# Ignore setuptools-less fallback
203+
except pkg_resources.DistributionNotFound:
204+
omit =
205+
""",
206+
)
207+
194208
s.shell.run(["nox", "-s", "blacken"], hide_output=False)
195209

196210
s.replace(

0 commit comments

Comments
 (0)