From 3d6a29de07cc09be663c90a3333f4cd33633994f Mon Sep 17 00:00:00 2001 From: Tianzi Cai Date: Mon, 21 Dec 2020 13:47:17 -0800 Subject: [PATCH] fix: flaky samples tests (#263) * chore: turn off type hints * fix: try get instead of delete --- samples/snippets/noxfile_config.py | 2 +- samples/snippets/subscriber_test.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/snippets/noxfile_config.py b/samples/snippets/noxfile_config.py index 32f8b4351..98c66af09 100644 --- a/samples/snippets/noxfile_config.py +++ b/samples/snippets/noxfile_config.py @@ -25,7 +25,7 @@ "ignored_versions": ["2.7"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them - "enforce_type_hints": True, + "enforce_type_hints": False, # An envvar key for determining the project id to use. Change it # to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a # build specific Cloud project. You can also use your own string diff --git a/samples/snippets/subscriber_test.py b/samples/snippets/subscriber_test.py index 91a005ee2..b9f0f1784 100644 --- a/samples/snippets/subscriber_test.py +++ b/samples/snippets/subscriber_test.py @@ -145,7 +145,7 @@ def subscription_dlq(subscriber_client, topic, dead_letter_topic): ) try: - subscription = subscriber_client.delete_subscription( + subscription = subscriber_client.get_subscription( request={"subscription": subscription_path} ) except NotFound: