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

Commit 6d48eb0

Browse files
committed
fix: add smt suffix in tests too; fix pytest eol error in py3.9
1 parent 263f4f9 commit 6d48eb0

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

samples/snippets/publisher_test.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,15 +316,16 @@ def test_create_topic_with_confluent_cloud_ingestion(
316316
def test_create_with_smt(
317317
publisher_client: pubsub_v1.PublisherClient, capsys: CaptureFixture[str]
318318
) -> None:
319+
smt_topic_name = f"{TOPIC_ID}-smt"
319320
# The scope of `topic_path` is limited to this function.
320-
topic_path = publisher_client.topic_path(PROJECT_ID, TOPIC_ID)
321+
topic_path = publisher_client.topic_path(PROJECT_ID, smt_topic_name)
321322

322323
try:
323324
publisher_client.delete_topic(request={"topic": topic_path})
324325
except NotFound:
325326
pass
326327

327-
publisher.create_topic_with_smt(PROJECT_ID, TOPIC_ID)
328+
publisher.create_topic_with_smt(PROJECT_ID, smt_topic_name)
328329

329330
out, _ = capsys.readouterr()
330331
assert f"Created topic: {topic_path} with SMT" in out

samples/snippets/requirements-test.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
backoff==2.2.1
2-
pytest==9.0.2
2+
pytest==8.4.2; python_version <= '3.9'
3+
pytest==9.0.2; python_version > '3.9'
34
mock==5.2.0
45
flaky==3.8.1
56
google-cloud-bigquery==3.40.0

samples/snippets/subscriber_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ def test_create_subscription_with_smt(
585585
capsys: CaptureFixture[str],
586586
) -> None:
587587
subscription_for_create_name = (
588-
f"subscription-test-subscription-for-create-with-smt-{PY_VERSION}-{UUID}"
588+
f"subscription-test-subscription-for-create-with-smt-{PY_VERSION}-{UUID}-smt"
589589
)
590590

591591
subscription_path = subscriber_client.subscription_path(

0 commit comments

Comments
 (0)