-
Notifications
You must be signed in to change notification settings - Fork 17
Description
File: google/cloud/client/__init__.py
Link: https://github.com/googleapis/python-cloud-core/blob/main/google/cloud/client/__init__.py#L33-L38
Description:
The current test suite does not cover both branches in the try/except for importing google.auth.api_key. This means the scenario where google.auth.api_key is not available is not tested and coverage testing fails.
try:
import google.auth.api_key
HAS_GOOGLE_AUTH_API_KEY = True
except ImportError:
HAS_GOOGLE_AUTH_API_KEY = False
Desired Action:
Investigate whether it's feasible and necessary to add a test case that simulates google.auth.api_key not being importable. If this is a valid state, a test should be added to ensure HAS_GOOGLE_AUTH_API_KEY is correctly set to False. If it's not a practically reachable state in supported environments, document why.
Temporary Measure:
The lines are currently marked with # pragma: no cover to unblock other work, but this should be revisited.