Skip to content

Commit 9e169f8

Browse files
committed
fix(generator): add coverage pragma comments for fallback path in compat template, and update goldens
1 parent 2d1d2a5 commit 9e169f8

9 files changed

Lines changed: 9 additions & 9 deletions

File tree

  • packages/gapic-generator

packages/gapic-generator/gapic/templates/%namespace/%name_%version/%sub/_compat.py.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import uuid
44

55
try:
66
from google.api_core.gapic_v1.requests import setup_request_id # type: ignore
7-
except ImportError:
7+
except ImportError: # pragma: NO COVER
88
# TODO: Remove this fallback when google-api-core >= 2.18.0 is the minimum required version.
99
def setup_request_id(request, field_name: str, is_proto3_optional: bool):
1010
"""Populate a UUID4 field in the request if it is not already set.

packages/gapic-generator/tests/integration/goldens/asset/google/cloud/asset_v1/_compat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
try:
2020
from google.api_core.gapic_v1.requests import setup_request_id # type: ignore
21-
except ImportError:
21+
except ImportError: # pragma: NO COVER
2222
# TODO: Remove this fallback when google-api-core >= 2.18.0 is the minimum required version.
2323
def setup_request_id(request, field_name: str, is_proto3_optional: bool):
2424
"""Populate a UUID4 field in the request if it is not already set.

packages/gapic-generator/tests/integration/goldens/credentials/google/iam/credentials_v1/_compat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
try:
2020
from google.api_core.gapic_v1.requests import setup_request_id # type: ignore
21-
except ImportError:
21+
except ImportError: # pragma: NO COVER
2222
# TODO: Remove this fallback when google-api-core >= 2.18.0 is the minimum required version.
2323
def setup_request_id(request, field_name: str, is_proto3_optional: bool):
2424
"""Populate a UUID4 field in the request if it is not already set.

packages/gapic-generator/tests/integration/goldens/eventarc/google/cloud/eventarc_v1/_compat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
try:
2020
from google.api_core.gapic_v1.requests import setup_request_id # type: ignore
21-
except ImportError:
21+
except ImportError: # pragma: NO COVER
2222
# TODO: Remove this fallback when google-api-core >= 2.18.0 is the minimum required version.
2323
def setup_request_id(request, field_name: str, is_proto3_optional: bool):
2424
"""Populate a UUID4 field in the request if it is not already set.

packages/gapic-generator/tests/integration/goldens/logging/google/cloud/logging_v2/_compat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
try:
2020
from google.api_core.gapic_v1.requests import setup_request_id # type: ignore
21-
except ImportError:
21+
except ImportError: # pragma: NO COVER
2222
# TODO: Remove this fallback when google-api-core >= 2.18.0 is the minimum required version.
2323
def setup_request_id(request, field_name: str, is_proto3_optional: bool):
2424
"""Populate a UUID4 field in the request if it is not already set.

packages/gapic-generator/tests/integration/goldens/logging_internal/google/cloud/logging_v2/_compat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
try:
2020
from google.api_core.gapic_v1.requests import setup_request_id # type: ignore
21-
except ImportError:
21+
except ImportError: # pragma: NO COVER
2222
# TODO: Remove this fallback when google-api-core >= 2.18.0 is the minimum required version.
2323
def setup_request_id(request, field_name: str, is_proto3_optional: bool):
2424
"""Populate a UUID4 field in the request if it is not already set.

packages/gapic-generator/tests/integration/goldens/redis/google/cloud/redis_v1/_compat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
try:
2020
from google.api_core.gapic_v1.requests import setup_request_id # type: ignore
21-
except ImportError:
21+
except ImportError: # pragma: NO COVER
2222
# TODO: Remove this fallback when google-api-core >= 2.18.0 is the minimum required version.
2323
def setup_request_id(request, field_name: str, is_proto3_optional: bool):
2424
"""Populate a UUID4 field in the request if it is not already set.

packages/gapic-generator/tests/integration/goldens/redis_selective/google/cloud/redis_v1/_compat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
try:
2020
from google.api_core.gapic_v1.requests import setup_request_id # type: ignore
21-
except ImportError:
21+
except ImportError: # pragma: NO COVER
2222
# TODO: Remove this fallback when google-api-core >= 2.18.0 is the minimum required version.
2323
def setup_request_id(request, field_name: str, is_proto3_optional: bool):
2424
"""Populate a UUID4 field in the request if it is not already set.

packages/gapic-generator/tests/integration/goldens/storagebatchoperations/google/cloud/storagebatchoperations_v1/_compat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
try:
2020
from google.api_core.gapic_v1.requests import setup_request_id # type: ignore
21-
except ImportError:
21+
except ImportError: # pragma: NO COVER
2222
# TODO: Remove this fallback when google-api-core >= 2.18.0 is the minimum required version.
2323
def setup_request_id(request, field_name: str, is_proto3_optional: bool):
2424
"""Populate a UUID4 field in the request if it is not already set.

0 commit comments

Comments
 (0)