From 3c0dad30e7249354162576da9386750937fa5c3e Mon Sep 17 00:00:00 2001 From: Takashi Matsuo Date: Sun, 31 May 2020 20:41:22 +0000 Subject: [PATCH] move the fixture back to module level --- dlp/risk_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlp/risk_test.py b/dlp/risk_test.py index 0164cf3b8c0e3..8d43c56b5b28d 100644 --- a/dlp/risk_test.py +++ b/dlp/risk_test.py @@ -44,7 +44,7 @@ # We observe sometimes all the tests in this file fail. In a # hypothesis where DLP service somehow loses the connection to the # topic, now we use function scope for Pub/Sub fixtures. -@pytest.fixture(scope="function") +@pytest.fixture(scope="module") def topic_id(): # Creates a pubsub topic, and tears it down. publisher = google.cloud.pubsub.PublisherClient() @@ -59,7 +59,7 @@ def topic_id(): publisher.delete_topic(topic_path) -@pytest.fixture(scope="function") +@pytest.fixture(scope="module") def subscription_id(topic_id): # Subscribes to a topic. subscriber = google.cloud.pubsub.SubscriberClient()