From dff50417c1d2005f84f53628d4d0674a54e59708 Mon Sep 17 00:00:00 2001 From: kevin-tian Date: Thu, 1 Feb 2024 14:40:34 -0500 Subject: [PATCH] Update invalid token test --- test/integration/test_auth_client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/integration/test_auth_client.py b/test/integration/test_auth_client.py index 031b89ce9..9bab9ac5e 100644 --- a/test/integration/test_auth_client.py +++ b/test/integration/test_auth_client.py @@ -15,6 +15,7 @@ import re from qiskit_ibm_runtime.api.exceptions import RequestsApiError +from qiskit_ibm_runtime.exceptions import IBMNotAuthorizedError from qiskit_ibm_runtime.api.client_parameters import ClientParameters from qiskit_ibm_runtime.api.clients import AuthClient from ..ibm_test_case import IBMTestCase @@ -41,7 +42,7 @@ def test_url_404(self, dependencies: IntegrationTestDependencies) -> None: def test_invalid_token(self, dependencies: IntegrationTestDependencies) -> None: """Test login using invalid token.""" qe_token = "INVALID_TOKEN" - with self.assertRaises(RequestsApiError): + with self.assertRaises(IBMNotAuthorizedError): _ = self._init_auth_client(qe_token, dependencies.url) @integration_test_setup(supported_channel=["ibm_quantum"], init_service=False)