Skip to content

Commit 5e94956

Browse files
committed
Teardown tables
1 parent c4a9830 commit 5e94956

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

pandas/tests/io/test_gbq.py

+3-7
Original file line numberDiff line numberDiff line change
@@ -158,19 +158,15 @@ def gbq_dataset(self):
158158
self.client = _get_client()
159159
self.dataset = self.client.dataset(dataset_id)
160160

161-
# Ensure previous test runs are removed
162-
self.client.delete_dataset(
163-
self.dataset, delete_contents=True, not_found_ok=True
164-
)
165-
161+
# Create the dataset if it doesn't already exist
166162
self.client.create_dataset(bigquery.Dataset(self.dataset), exists_ok=True)
167163

168164
table_name = "".join(random.choices(string.ascii_lowercase, k=10))
169165
destination_table = f"{dataset_id}.{table_name}"
170166
yield destination_table
171167

172-
# Teardown Dataset
173-
self.client.delete_dataset(self.dataset, delete_contents=True)
168+
# Teardown tables created
169+
self.client.delete_table(destination_table, not_found_ok=True)
174170

175171
def test_roundtrip(self, gbq_dataset):
176172
destination_table = gbq_dataset

0 commit comments

Comments
 (0)