File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 21
21
TEST_SUBSCRIPTION = 'iam-test-subscription'
22
22
23
23
24
- @pytest .fixture
24
+ @pytest .fixture ( scope = 'module' )
25
25
def test_topic ():
26
26
client = pubsub .Client ()
27
27
topic = client .topic (TEST_TOPIC )
28
- topic .create ()
28
+
29
+ if not topic .exists ():
30
+ topic .create ()
31
+
29
32
yield topic
33
+
30
34
if topic .exists ():
31
35
topic .delete ()
32
36
Original file line number Diff line number Diff line change 22
22
TEST_SUBSCRIPTION = 'subscription-test-subscription'
23
23
24
24
25
- @pytest .fixture
25
+ @pytest .fixture ( scope = 'module' )
26
26
def test_topic ():
27
27
client = pubsub .Client ()
28
28
topic = client .topic (TEST_TOPIC )
29
- topic .create ()
29
+
30
+ if not topic .exists ():
31
+ topic .create ()
32
+
30
33
yield topic
34
+
31
35
if topic .exists ():
32
36
topic .delete ()
33
37
You can’t perform that action at this time.
0 commit comments