Skip to content

Commit

Permalink
link issue to move emulator code
Browse files Browse the repository at this point in the history
  • Loading branch information
ohmayr committed Jan 24, 2025
1 parent 0f09432 commit 7099d5e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions google/cloud/pubsub_v1/subscriber/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ def __init__(
# Sanity check: Is our goal to use the emulator?
# If so, create a grpc insecure channel with the emulator host
# as the target.
# TODO(https://github.com/googleapis/python-pubsub/issues/1349): Move the emulator
# code below to test files.
if os.environ.get("PUBSUB_EMULATOR_HOST"):
kwargs["client_options"] = {
"api_endpoint": os.environ.get("PUBSUB_EMULATOR_HOST")
Expand Down
4 changes: 3 additions & 1 deletion google/pubsub_v1/services/publisher/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,9 @@ def __init__(
else cast(Callable[..., PublisherTransport], transport)
)
# initialize with the provided callable or the passed in class


# TODO(https://github.com/googleapis/python-pubsub/issues/1349): Move the emulator
# code below to test files.
emulator_host = os.environ.get("PUBSUB_EMULATOR_HOST")
if emulator_host:
if issubclass(transport_init, type(self)._transport_registry["grpc"]):
Expand Down
2 changes: 2 additions & 0 deletions google/pubsub_v1/services/schema_service/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,8 @@ def __init__(
)
# initialize with the provided callable or the passed in class

# TODO(https://github.com/googleapis/python-pubsub/issues/1349): Move the emulator
# code below to test files.
emulator_host = os.environ.get("PUBSUB_EMULATOR_HOST")
if emulator_host:
if issubclass(transport_init, type(self)._transport_registry["grpc"]):
Expand Down
2 changes: 2 additions & 0 deletions google/pubsub_v1/services/subscriber/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,8 @@ def __init__(
)
# initialize with the provided callable or the passed in class

# TODO(https://github.com/googleapis/python-pubsub/issues/1349): Move the emulator
# code below to test files.
emulator_host = os.environ.get("PUBSUB_EMULATOR_HOST")
if emulator_host:
if issubclass(transport_init, type(self)._transport_registry["grpc"]):
Expand Down

0 comments on commit 7099d5e

Please sign in to comment.