Skip to content

Commit 2da7bfa

Browse files
Run only test_external_browser_successful
1 parent 847c154 commit 2da7bfa

File tree

2 files changed

+39
-39
lines changed

2 files changed

+39
-39
lines changed

ci/container/test_authentication.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export PYTHONPATH=$SOURCE_ROOT
1919

2020
python3 -m pip install --break-system-packages -e ".[development]"
2121

22-
python3 -m pytest test/auth/ --ignore=test/auth/aio
22+
#python3 -m pytest test/auth/ --ignore=test/auth/aio
2323

2424
python3 -m pip install --break-system-packages -e ".[development,aio,aioboto]"
25-
python3 -m pytest -vvv test/auth/aio/
25+
python3 -m pytest -vvv test/auth/aio/ -k "test_external_browser_successful"

test/auth/aio/authorization_test_helper.py

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -76,50 +76,50 @@ async def connect_and_provide_credentials(
7676
):
7777
import asyncio
7878

79-
try:
80-
# Start connection as an async task in the main event loop
81-
# This allows the browser to be opened from the main thread context
82-
connect_task = asyncio.create_task(self.connect_and_execute_simple_query())
83-
84-
if self.auth_test_env == "docker":
85-
# Give connection time to start and open the browser
86-
await asyncio.sleep(5)
87-
88-
# Run browser automation in a thread
89-
loop = asyncio.get_running_loop()
90-
await loop.run_in_executor(
91-
None,
92-
self._provide_credentials,
93-
scenario,
94-
login,
95-
password,
96-
)
79+
# try:
80+
# Start connection as an async task in the main event loop
81+
# This allows the browser to be opened from the main thread context
82+
connect_task = asyncio.create_task(self.connect_and_execute_simple_query())
9783

98-
# Wait for connection to complete
99-
await connect_task
84+
if self.auth_test_env == "docker":
85+
# Give connection time to start and open the browser
86+
await asyncio.sleep(5)
87+
88+
# Run browser automation in a thread
89+
loop = asyncio.get_running_loop()
90+
await loop.run_in_executor(
91+
None,
92+
self._provide_credentials,
93+
scenario,
94+
login,
95+
password,
96+
)
10097

101-
except Exception as e:
102-
self.error_msg = e
103-
logger.error(e)
98+
# Wait for connection to complete
99+
await connect_task
100+
101+
# except Exception as e:
102+
# self.error_msg = e
103+
# logger.error(e)
104104

105105
def get_error_msg(self) -> str:
106106
return str(self.error_msg)
107107

108108
async def connect_and_execute_simple_query(self):
109-
try:
110-
logger.info("Trying to connect to Snowflake")
111-
async with snowflake.connector.aio.SnowflakeConnection(
112-
**self.configuration
113-
) as con:
114-
logger.info("Connected to Snowflake, executing query")
115-
result = await con.cursor().execute("select 1;")
116-
logger.debug(await result.fetchall())
117-
logger.info("Successfully connected to Snowflake")
118-
return True
119-
except Exception as e:
120-
self.error_msg = e
121-
logger.error(e)
122-
return False
109+
# try:
110+
logger.info("Trying to connect to Snowflake")
111+
async with snowflake.connector.aio.SnowflakeConnection(
112+
**self.configuration
113+
) as con:
114+
logger.info("Connected to Snowflake, executing query")
115+
result = await con.cursor().execute("select 1;")
116+
logger.debug(await result.fetchall())
117+
logger.info("Successfully connected to Snowflake")
118+
return True
119+
# except Exception as e:
120+
# self.error_msg = e
121+
# logger.error(e)
122+
# return False
123123

124124
async def connect_and_execute_set_session_state(self, key: str, value: str):
125125
try:

0 commit comments

Comments
 (0)