24
24
import pytest
25
25
26
26
import snowflake .connector .aio
27
- from snowflake .connector .auth ._auth import delete_temporary_credential
28
27
29
28
sys .path .append (os .path .dirname (os .path .dirname (os .path .abspath (__file__ ))))
30
29
@@ -77,11 +76,7 @@ async def fin():
77
76
78
77
79
78
@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 ),
85
80
reason = "SSO and ADMIN connection parameters must be provided." ,
86
81
)
87
82
async def test_connect_externalbrowser (token_validity_test_values ):
@@ -90,11 +85,16 @@ async def test_connect_externalbrowser(token_validity_test_values):
90
85
In order to run this test, remove the above pytest.mark.skip annotation and run it. It will popup a windows once
91
86
but the rest connections should not create popups.
92
87
"""
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
98
98
CONNECTION_PARAMETERS_SSO ["client_store_temporary_credential" ] = True
99
99
100
100
# change database and schema to non-default one
0 commit comments