Skip to content

Commit 90af8cf

Browse files
[Storage] Fix live test failures (#47130)
1 parent 9707083 commit 90af8cf

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

sdk/storage/azure-storage-blob/tests/test_cpk_n_async.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
AccountSasPermissions,
2020
BlobBlock,
2121
BlobSasPermissions,
22+
BlobServiceClient as SyncBlobServiceClient,
2223
BlobType,
2324
ContainerEncryptionScope,
2425
ContainerSasPermissions,
@@ -56,9 +57,10 @@ async def _setup(self, bsc):
5657

5758
def _teardown(self, bsc):
5859
if self.is_live:
59-
loop = asyncio.get_event_loop()
6060
try:
61-
loop.run_until_complete(bsc.delete_container(self.container_name))
61+
sync_credential = self.get_credential(SyncBlobServiceClient, is_async=False)
62+
with SyncBlobServiceClient(account_url=bsc.url, credential=sync_credential) as sync_bsc:
63+
sync_bsc.delete_container(self.container_name)
6264
except HttpResponseError:
6365
pass
6466

0 commit comments

Comments
 (0)