diff --git a/sdk/keyvault/azure-keyvault-secrets/tests/test_secrets_async.py b/sdk/keyvault/azure-keyvault-secrets/tests/test_secrets_async.py index 80f969bbe31a..95431a49f05e 100644 --- a/sdk/keyvault/azure-keyvault-secrets/tests/test_secrets_async.py +++ b/sdk/keyvault/azure-keyvault-secrets/tests/test_secrets_async.py @@ -181,8 +181,9 @@ async def test_list_deleted_secrets(self, azure_keyvault_url, **kwargs): self.assertIsNotNone(deleted_secret.deleted_date) self.assertIsNotNone(deleted_secret.scheduled_purge_date) self.assertIsNotNone(deleted_secret.recovery_id) - expected_secret = expected[deleted_secret.name] - self._assert_secret_attributes_equal(expected_secret.properties, deleted_secret.properties) + if deleted_secret.name in expected: + expected_secret = expected[deleted_secret.name] + self._assert_secret_attributes_equal(expected_secret.properties, deleted_secret.properties) @KeyVaultPreparer() async def test_list_versions(self, azure_keyvault_url, **kwargs):