@pytest.fixture
def temporary_dataset():
 bigquery_client = bigquery.Client()
 dataset = bigquery_client.dataset(DATASET_ID)
 if dataset.exists():
  dataset.delete()
 (yield)
 if dataset.exists():
  dataset.delete()

@ pytest . fixture def temporary_dataset ( ) : bigquery_client = bigquery . Client ( ) dataset = bigquery_client . dataset ( DATASET_ID ) if dataset . exists ( ) : dataset . delete ( ) ( yield ) if dataset . exists ( ) : dataset . delete ( )
fixture that ensures the test dataset does not exist before or after a test .