diff --git a/sdk/keyvault/azure-keyvault-keys/tests/test_key_client.py b/sdk/keyvault/azure-keyvault-keys/tests/test_key_client.py index ed0caf5f9f0b..61d1a793812c 100644 --- a/sdk/keyvault/azure-keyvault-keys/tests/test_key_client.py +++ b/sdk/keyvault/azure-keyvault-keys/tests/test_key_client.py @@ -62,6 +62,7 @@ def emit(self, record): self.messages.append(record) +@pytest.mark.usefixtures("recorded_test", "variable_recorder") class TestKeyClient(KeyVaultTestCase, KeysTestCase): def _assert_jwks_equal(self, jwk1, jwk2): for field in JsonWebKey._FIELDS: @@ -177,7 +178,6 @@ def _to_bytes(hex): @pytest.mark.parametrize("api_version,is_hsm",all_api_versions) @KeysClientPreparer() - @recorded_by_proxy def test_key_crud_operations(self, client, is_hsm, **kwargs): set_bodiless_matcher() assert client is not None @@ -242,7 +242,6 @@ def test_key_crud_operations(self, client, is_hsm, **kwargs): @pytest.mark.parametrize("api_version,is_hsm",only_hsm) @KeysClientPreparer() - @recorded_by_proxy def test_rsa_public_exponent(self, client, **kwargs): """The public exponent of a Managed HSM RSA key can be specified during creation""" set_bodiless_matcher() @@ -255,7 +254,6 @@ def test_rsa_public_exponent(self, client, **kwargs): @pytest.mark.parametrize("api_version,is_hsm",all_api_versions) @KeysClientPreparer() - @recorded_by_proxy def test_backup_restore(self, client, is_hsm, **kwargs): set_bodiless_matcher() assert client is not None @@ -282,7 +280,6 @@ def test_backup_restore(self, client, is_hsm, **kwargs): @pytest.mark.parametrize("api_version,is_hsm",all_api_versions) @KeysClientPreparer() - @recorded_by_proxy def test_key_list(self, client, is_hsm, **kwargs): set_bodiless_matcher() @@ -307,7 +304,6 @@ def test_key_list(self, client, is_hsm, **kwargs): @pytest.mark.parametrize("api_version,is_hsm",all_api_versions) @KeysClientPreparer() - @recorded_by_proxy def test_list_versions(self, client, is_hsm, **kwargs): assert client is not None @@ -333,7 +329,6 @@ def test_list_versions(self, client, is_hsm, **kwargs): @pytest.mark.parametrize("api_version,is_hsm",all_api_versions) @KeysClientPreparer() - @recorded_by_proxy def test_list_deleted_keys(self, client, is_hsm, **kwargs): set_bodiless_matcher() assert client is not None @@ -364,7 +359,6 @@ def test_list_deleted_keys(self, client, is_hsm, **kwargs): @pytest.mark.parametrize("api_version,is_hsm",all_api_versions) @KeysClientPreparer() - @recorded_by_proxy def test_recover(self, client, is_hsm, **kwargs): set_bodiless_matcher() assert client is not None @@ -391,7 +385,6 @@ def test_recover(self, client, is_hsm, **kwargs): @pytest.mark.parametrize("api_version,is_hsm",all_api_versions) @KeysClientPreparer() - @recorded_by_proxy def test_purge(self, client, is_hsm, **kwargs): set_bodiless_matcher() assert client is not None @@ -423,7 +416,6 @@ def test_purge(self, client, is_hsm, **kwargs): @pytest.mark.parametrize("api_version,is_hsm",logging_enabled) @KeysClientPreparer(logging_enable = True) - @recorded_by_proxy def test_logging_enabled(self, client, is_hsm, **kwargs): mock_handler = MockHandler() @@ -458,7 +450,6 @@ def test_logging_enabled(self, client, is_hsm, **kwargs): @pytest.mark.parametrize("api_version,is_hsm",logging_enabled) @KeysClientPreparer(logging_enable = False) - @recorded_by_proxy def test_logging_disabled(self, client, is_hsm, **kwargs): mock_handler = MockHandler() @@ -492,7 +483,6 @@ def test_logging_disabled(self, client, is_hsm, **kwargs): @pytest.mark.parametrize("api_version,is_hsm",only_hsm_7_3) @KeysClientPreparer() - @recorded_by_proxy def test_get_random_bytes(self, client, **kwargs): assert client @@ -508,7 +498,6 @@ def test_get_random_bytes(self, client, **kwargs): @pytest.mark.parametrize("api_version,is_hsm",only_7_3) @KeysClientPreparer() - @recorded_by_proxy def test_key_release(self, client, **kwargs): set_bodiless_matcher() attestation_uri = self._get_attestation_uri() @@ -528,7 +517,6 @@ def test_key_release(self, client, **kwargs): @pytest.mark.parametrize("api_version,is_hsm",only_hsm_7_3) @KeysClientPreparer() - @recorded_by_proxy def test_imported_key_release(self, client, **kwargs): set_bodiless_matcher() attestation_uri = self._get_attestation_uri() @@ -548,7 +536,6 @@ def test_imported_key_release(self, client, **kwargs): @pytest.mark.parametrize("api_version,is_hsm",only_7_3) @KeysClientPreparer() - @recorded_by_proxy def test_update_release_policy(self, client, **kwargs): set_bodiless_matcher() attestation_uri = self._get_attestation_uri() @@ -590,7 +577,6 @@ def test_update_release_policy(self, client, **kwargs): #Immutable policies aren't currently supported on Managed HSM @pytest.mark.parametrize("api_version,is_hsm",only_vault_7_3) @KeysClientPreparer() - @recorded_by_proxy def test_immutable_release_policy(self, client, **kwargs): set_bodiless_matcher() attestation_uri = self._get_attestation_uri() @@ -624,7 +610,6 @@ def test_immutable_release_policy(self, client, **kwargs): @pytest.mark.parametrize("api_version,is_hsm",only_vault_7_3) @KeysClientPreparer() - @recorded_by_proxy def test_key_rotation(self, client, **kwargs): set_bodiless_matcher() if (not is_public_cloud() and self.is_live): @@ -641,7 +626,6 @@ def test_key_rotation(self, client, **kwargs): @pytest.mark.parametrize("api_version,is_hsm",only_vault_7_3) @KeysClientPreparer() - @recorded_by_proxy def test_key_rotation_policy(self, client, **kwargs): set_bodiless_matcher() if (not is_public_cloud() and self.is_live): @@ -709,7 +693,6 @@ def test_key_rotation_policy(self, client, **kwargs): @pytest.mark.parametrize("api_version,is_hsm",all_api_versions) @KeysClientPreparer() - @recorded_by_proxy def test_get_cryptography_client(self, client, is_hsm, **kwargs): key_name = self.get_resource_name("key-name") key = self._create_rsa_key(client, key_name, hardware_protected=is_hsm) diff --git a/sdk/tables/azure-data-tables/tests/test_table_batch.py b/sdk/tables/azure-data-tables/tests/test_table_batch.py index 722871d60176..07a37618ce26 100644 --- a/sdk/tables/azure-data-tables/tests/test_table_batch.py +++ b/sdk/tables/azure-data-tables/tests/test_table_batch.py @@ -282,11 +282,9 @@ def test_batch_update_if_doesnt_match(self, tables_storage_account_name, tables_ @tables_decorator_with_wraps def test_batch_single_op_if_doesnt_match(self, variable_recorder, tables_storage_account_name=None, tables_primary_storage_account_key=None): # this can be reverted to set_bodiless_matcher() after tests are re-recorded and don't contain these headers - # set_custom_default_matcher( - # compare_bodies=False, excluded_headers="Authorization,Content-Length,x-ms-client-request-id,x-ms-request-id" - # ) - - # Above section is intentionally commented to trigger a playback error, to show how error raising is handled + set_custom_default_matcher( + compare_bodies=False, excluded_headers="Authorization,Content-Length,x-ms-client-request-id,x-ms-request-id" + ) # variable_recorder directly returns the dictionary containing recorded variables. In live mode, this is an # empty dictionary; in playback mode, this is populated with any variables that were recorded previously.