Skip to content

Commit c2370a8

Browse files
committed
Merge pull request #1074 from tseaver/1071-bigquery-system_tests_py3k
#1071: fix BQ system tests under Py3k
2 parents 6f1debf + 2ba2424 commit c2370a8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

system_tests/bigquery.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,15 +263,16 @@ def test_load_table_from_storage_then_dump_table(self):
263263
self.to_delete.append(bucket)
264264

265265
blob = bucket.blob(BLOB_NAME)
266-
self.to_delete.insert(0, blob)
267266

268-
with tempfile.TemporaryFile() as csv_file:
267+
with tempfile.TemporaryFile(mode='w+') as csv_file:
269268
writer = csv.writer(csv_file)
270269
writer.writerow(('Full Name', 'Age'))
271270
writer.writerows(ROWS)
272271
blob.upload_from_file(
273272
csv_file, rewind=True, content_type='text/csv')
274273

274+
self.to_delete.insert(0, blob)
275+
275276
dataset = CLIENT.dataset(DATASET_NAME)
276277
dataset.create()
277278
self.to_delete.append(dataset)

0 commit comments

Comments
 (0)