Skip to content

Commit dd80071

Browse files
fix async sso test
1 parent 4167234 commit dd80071

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

test/integ/aio/sso/test_connection_manual_async.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import pytest
2525

2626
import snowflake.connector.aio
27-
from snowflake.connector.auth._auth import delete_temporary_credential
2827

2928
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
3029

@@ -77,11 +76,7 @@ async def fin():
7776

7877

7978
@pytest.mark.skipif(
80-
not (
81-
CONNECTION_PARAMETERS_SSO
82-
and CONNECTION_PARAMETERS_ADMIN
83-
and delete_temporary_credential
84-
),
79+
not (CONNECTION_PARAMETERS_SSO and CONNECTION_PARAMETERS_ADMIN),
8580
reason="SSO and ADMIN connection parameters must be provided.",
8681
)
8782
async def test_connect_externalbrowser(token_validity_test_values):
@@ -90,11 +85,16 @@ async def test_connect_externalbrowser(token_validity_test_values):
9085
In order to run this test, remove the above pytest.mark.skip annotation and run it. It will popup a windows once
9186
but the rest connections should not create popups.
9287
"""
93-
delete_temporary_credential(
94-
host=CONNECTION_PARAMETERS_SSO["host"],
95-
user=CONNECTION_PARAMETERS_SSO["user"],
96-
cred_type=ID_TOKEN,
97-
) # delete existing temporary credential
88+
from snowflake.connector.token_cache import TokenCache, TokenKey, TokenType
89+
90+
TokenCache.make().remove(
91+
TokenKey(
92+
CONNECTION_PARAMETERS_SSO["host"],
93+
CONNECTION_PARAMETERS_SSO["user"],
94+
TokenType.ID_TOKEN,
95+
)
96+
)
97+
# delete existing temporary credential
9898
CONNECTION_PARAMETERS_SSO["client_store_temporary_credential"] = True
9999

100100
# change database and schema to non-default one

0 commit comments

Comments
 (0)