diff --git a/sdk/storage/azure-storage-file-share/tests/test_file.py b/sdk/storage/azure-storage-file-share/tests/test_file.py index 1224a52dbbd8..6d404b365fd9 100644 --- a/sdk/storage/azure-storage-file-share/tests/test_file.py +++ b/sdk/storage/azure-storage-file-share/tests/test_file.py @@ -136,7 +136,7 @@ def _wait_for_async_copy(self, share_name, file_path): while properties.copy.status != 'success': count = count + 1 if count > 10: - self.fail('Timed out waiting for async copy to complete.') + pytest.fail('Timed out waiting for async copy to complete.') self.sleep(6) properties = file_client.get_file_properties() assert properties.copy.status == 'success' diff --git a/sdk/storage/azure-storage-file-share/tests/test_file_async.py b/sdk/storage/azure-storage-file-share/tests/test_file_async.py index 6d4d0d56426d..4daa252d6dce 100644 --- a/sdk/storage/azure-storage-file-share/tests/test_file_async.py +++ b/sdk/storage/azure-storage-file-share/tests/test_file_async.py @@ -151,7 +151,7 @@ async def _wait_for_async_copy(self, share_name, file_path): while properties.copy.status != 'success': count = count + 1 if count > 10: - self.fail('Timed out waiting for async copy to complete.') + pytest.fail('Timed out waiting for async copy to complete.') self.sleep(6) properties = await file_client.get_file_properties() assert properties.copy.status == 'success'