Skip to content

Commit

Permalink
Fix tests to reflect change in exception type
Browse files Browse the repository at this point in the history
  • Loading branch information
craddm committed Nov 15, 2024
1 parent 041b5a4 commit 7ae72ab
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tests/external/api/test_credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
DeviceCodeCredential,
)

from click.exceptions import Exit
from data_safe_haven.directories import config_dir
from data_safe_haven.exceptions import DataSafeHavenAzureError
from data_safe_haven.external.api.credentials import (
AzureSdkCredential,
DeferredCredential,
Expand Down Expand Up @@ -37,8 +37,7 @@ def test_confirm_credentials_interactive_fail(
DeferredCredential.cache_ = set()
credential = AzureSdkCredential(skip_confirmation=False)
with pytest.raises(
DataSafeHavenAzureError,
match="Error getting account information from Azure CLI.",
Exit
):
credential.get_credential()

Expand All @@ -62,8 +61,7 @@ def test_decode_token_error(
):
credential = AzureSdkCredential(skip_confirmation=True)
with pytest.raises(
DataSafeHavenAzureError,
match="Error getting account information from Azure CLI.",
Exit
):
credential.decode_token(credential.token)

Expand Down

0 comments on commit 7ae72ab

Please sign in to comment.