Skip to content

Commit f1657d2

Browse files
Filter out Deprecation warnings from test_incalid_conection_parameter… (#2330)
1 parent a051741 commit f1657d2

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

test/integ/test_connection.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -878,8 +878,13 @@ def test_invalid_connection_parameter(db_parameters, name, value, exc_warn):
878878
try:
879879
conn = snowflake.connector.connect(**conn_params)
880880
assert getattr(conn, "_" + name) == value
881-
assert len(w) == 1
882-
assert str(w[0].message) == str(exc_warn)
881+
# TODO: SNOW-2114216 remove filtering once the root cause for deprecation warning is fixed
882+
# Filter out the deprecation warning
883+
filtered_w = [
884+
warning for warning in w if warning.category != DeprecationWarning
885+
]
886+
assert len(filtered_w) == 1
887+
assert str(filtered_w[0].message) == str(exc_warn)
883888
finally:
884889
conn.close()
885890

@@ -904,7 +909,12 @@ def test_invalid_connection_parameters_turned_off(db_parameters):
904909
conn = snowflake.connector.connect(**conn_params)
905910
assert conn._autocommit == conn_params["autocommit"]
906911
assert conn._applucation == conn_params["applucation"]
907-
assert len(w) == 0
912+
# TODO: SNOW-2114216 remove filtering once the root cause for deprecation warning is fixed
913+
# Filter out the deprecation warning
914+
filtered_w = [
915+
warning for warning in w if warning.category != DeprecationWarning
916+
]
917+
assert len(filtered_w) == 0
908918
finally:
909919
conn.close()
910920

0 commit comments

Comments
 (0)