@pytest.fixture
def temporary_topic():
 pubsub_client = pubsub.Client()
 topic = pubsub_client.topic(TOPIC_NAME)
 if topic.exists():
  topic.delete()
 (yield)
 if topic.exists():
  topic.delete()

@ pytest . fixture def temporary_topic ( ) : pubsub_client = pubsub . Client ( ) topic = pubsub_client . topic ( TOPIC_NAME ) if topic . exists ( ) : topic . delete ( ) ( yield ) if topic . exists ( ) : topic . delete ( )
fixture that ensures the test dataset does not exist before or after a test .