Skip to content

Commit 5b4ad27

Browse files
peter-zheng-gdandhlee
authored andcommitted
[Asset] Test: fix bucket clean up logic. [(#1845)](#1845)
1 parent dba0389 commit 5b4ad27

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

asset/snippets/snippets/quickstart_exportassets_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ def storage_client():
3333

3434
@pytest.fixture(scope='module')
3535
def asset_bucket(storage_client):
36-
storage_client.create_bucket(BUCKET)
36+
bucket = storage_client.create_bucket(BUCKET)
37+
38+
yield BUCKET
3739

3840
try:
39-
storage_client.delete_bucket(BUCKET)
41+
bucket.delete(force=True)
4042
except Exception as e:
4143
print('Failed to delete bucket{}'.format(BUCKET))
4244
raise e
4345

44-
yield BUCKET
45-
4646

4747
def test_export_assets(asset_bucket, capsys):
4848
dump_file_path = 'gs://{}/assets-dump.txt'.format(asset_bucket)

0 commit comments

Comments
 (0)