Skip to content
This repository was archived by the owner on Mar 9, 2026. It is now read-only.

Commit bb1ed8d

Browse files
fix: Test failures due to grpcio changes
* Failures can be found in googleapis/python-api-common-protos#223
1 parent ff229a5 commit bb1ed8d

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

tests/unit/pubsub_v1/publisher/test_publisher_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,15 @@ def test_init_w_api_endpoint(creds):
135135

136136
assert (client._transport.grpc_channel._channel.target()).decode(
137137
"utf-8"
138-
) == "testendpoint.google.com:443"
138+
) == "dns:///testendpoint.google.com:443" if grpc.__version__ >= "1.63.0" else "testendpoint.google.com:443"
139139

140140

141141
def test_init_w_empty_client_options(creds):
142142
client = publisher.Client(client_options={}, credentials=creds)
143143

144144
assert (client._transport.grpc_channel._channel.target()).decode(
145145
"utf-8"
146-
) == publisher_client.PublisherClient.SERVICE_ADDRESS
146+
) == ()"dns:///pubsub.googleapis.com:443"
147147

148148

149149
def test_init_client_options_pass_through():
@@ -182,7 +182,7 @@ def test_init_emulator(monkeypatch):
182182
# Sadly, there seems to be no good way to do this without poking at
183183
# the private API of gRPC.
184184
channel = client._transport.publish._channel
185-
assert channel.target().decode("utf8") == "/foo/bar:123"
185+
assert channel.target().decode("utf8") == "dns:////foo/bar:123"
186186

187187

188188
def test_message_ordering_enabled(creds):

tests/unit/pubsub_v1/subscriber/test_subscriber_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,15 @@ def test_init_w_api_endpoint(creds):
6868

6969
assert (client._transport.grpc_channel._channel.target()).decode(
7070
"utf-8"
71-
) == "testendpoint.google.com:443"
71+
) == "dns:///testendpoint.google.com:443"
7272

7373

7474
def test_init_w_empty_client_options(creds):
7575
client = subscriber.Client(client_options={}, credentials=creds)
7676

7777
assert (client._transport.grpc_channel._channel.target()).decode(
7878
"utf-8"
79-
) == subscriber_client.SubscriberClient.SERVICE_ADDRESS
79+
) == "dns:///pubsub.googleapis.com:443"
8080

8181

8282
def test_init_client_options_pass_through():
@@ -115,7 +115,7 @@ def test_init_emulator(monkeypatch):
115115
# Sadly, there seems to be no good way to do this without poking at
116116
# the private API of gRPC.
117117
channel = client._transport.pull._channel
118-
assert channel.target().decode("utf8") == "/baz/bacon:123"
118+
assert channel.target().decode("utf8") == "dns:////baz/bacon:123"
119119

120120

121121
def test_class_method_factory():

0 commit comments

Comments
 (0)