Skip to content

Commit c965070

Browse files
authored
SNOW-1760173: fix test failure (#2078)
1 parent d73afee commit c965070

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

test/integ/test_connection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ def exe(sql):
516516
@pytest.mark.timeout(15)
517517
@pytest.mark.skipolddriver
518518
def test_invalid_account_timeout():
519-
with pytest.raises(OperationalError):
519+
with pytest.raises(InterfaceError):
520520
snowflake.connector.connect(
521521
account="bogus", user="test", password="test", login_timeout=5
522522
)
@@ -579,7 +579,7 @@ def test_us_west_connection(tmpdir):
579579
Notes:
580580
Region is deprecated.
581581
"""
582-
with pytest.raises(OperationalError):
582+
with pytest.raises(InterfaceError):
583583
# must reach Snowflake
584584
snowflake.connector.connect(
585585
account="testaccount1234",

test/unit/test_connection.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@
2323

2424
import snowflake.connector
2525
from snowflake.connector.connection import DEFAULT_CONFIGURATION
26-
from snowflake.connector.errors import Error, OperationalError, ProgrammingError
26+
from snowflake.connector.errors import (
27+
Error,
28+
InterfaceError,
29+
OperationalError,
30+
ProgrammingError,
31+
)
2732
from snowflake.connector.network import SnowflakeRestful
2833

2934
from ..randomize import random_string
@@ -345,7 +350,7 @@ def test_invalid_backoff_policy():
345350
# passing a non-generator function should not work
346351
_ = fake_connector(backoff_policy=lambda: None)
347352

348-
with pytest.raises(OperationalError):
353+
with pytest.raises(InterfaceError):
349354
# passing a generator function should make it pass config and error during connection
350355
_ = fake_connector(backoff_policy=zero_backoff)
351356

0 commit comments

Comments
 (0)