Skip to content

Commit 6d7575a

Browse files
sfc-gh-mkubiksfc-gh-fpawlowski
authored andcommitted
Filter out Deprecation warnings from test_incalid_conection_parameter… (#2330)
(cherry picked from commit f1657d2)
1 parent c4b995f commit 6d7575a

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
@@ -877,8 +877,13 @@ def test_invalid_connection_parameter(db_parameters, name, value, exc_warn):
877877
try:
878878
conn = snowflake.connector.connect(**conn_params)
879879
assert getattr(conn, "_" + name) == value
880-
assert len(w) == 1
881-
assert str(w[0].message) == str(exc_warn)
880+
# TODO: SNOW-2114216 remove filtering once the root cause for deprecation warning is fixed
881+
# Filter out the deprecation warning
882+
filtered_w = [
883+
warning for warning in w if warning.category != DeprecationWarning
884+
]
885+
assert len(filtered_w) == 1
886+
assert str(filtered_w[0].message) == str(exc_warn)
882887
finally:
883888
conn.close()
884889

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

0 commit comments

Comments
 (0)