diff --git a/sdk/identity/azure-identity/tests/test_powershell_credential.py b/sdk/identity/azure-identity/tests/test_powershell_credential.py index 79a36f9a28a4..898f1714e33f 100644 --- a/sdk/identity/azure-identity/tests/test_powershell_credential.py +++ b/sdk/identity/azure-identity/tests/test_powershell_credential.py @@ -260,7 +260,7 @@ def fake_Popen(command, **_): assert command[-1].startswith("pwsh -NonInteractive -EncodedCommand ") encoded_script = command[-1].split()[-1] decoded_script = base64.b64decode(encoded_script).decode("utf-16-le") - match = re.search("Get-AzAccessToken -ResourceUrl '(\S+)'(?: -TenantId (\S+))?", decoded_script) + match = re.search(r"Get-AzAccessToken -ResourceUrl '(\S+)'(?: -TenantId (\S+))?", decoded_script) tenant = match.groups()[1] assert tenant is None or tenant == second_tenant, 'unexpected tenant "{}"'.format(tenant) @@ -292,7 +292,7 @@ def fake_Popen(command, **_): assert command[-1].startswith("pwsh -NonInteractive -EncodedCommand ") encoded_script = command[-1].split()[-1] decoded_script = base64.b64decode(encoded_script).decode("utf-16-le") - match = re.search("Get-AzAccessToken -ResourceUrl '(\S+)'(?: -TenantId (\S+))?", decoded_script) + match = re.search(r"Get-AzAccessToken -ResourceUrl '(\S+)'(?: -TenantId (\S+))?", decoded_script) tenant = match.groups()[1] assert tenant is None, "credential shouldn't accept an explicit tenant ID" diff --git a/sdk/identity/azure-identity/tests/test_powershell_credential_async.py b/sdk/identity/azure-identity/tests/test_powershell_credential_async.py index fec0b4c013de..fa55a8e4b90c 100644 --- a/sdk/identity/azure-identity/tests/test_powershell_credential_async.py +++ b/sdk/identity/azure-identity/tests/test_powershell_credential_async.py @@ -263,7 +263,7 @@ async def fake_exec(*args, **_): assert command.startswith("pwsh -NonInteractive -EncodedCommand ") encoded_script = command.split()[-1] decoded_script = base64.b64decode(encoded_script).decode("utf-16-le") - match = re.search("Get-AzAccessToken -ResourceUrl '(\S+)'(?: -TenantId (\S+))?", decoded_script) + match = re.search(r"Get-AzAccessToken -ResourceUrl '(\S+)'(?: -TenantId (\S+))?", decoded_script) tenant = match[2] assert tenant is None or tenant == second_tenant, 'unexpected tenant "{}"'.format(tenant) @@ -296,7 +296,7 @@ async def fake_exec(*args, **_): assert command.startswith("pwsh -NonInteractive -EncodedCommand ") encoded_script = command.split()[-1] decoded_script = base64.b64decode(encoded_script).decode("utf-16-le") - match = re.search("Get-AzAccessToken -ResourceUrl '(\S+)'(?: -TenantId (\S+))?", decoded_script) + match = re.search(r"Get-AzAccessToken -ResourceUrl '(\S+)'(?: -TenantId (\S+))?", decoded_script) tenant = match[2] assert tenant is None, "credential shouldn't accept an explicit tenant ID"