Skip to content

Commit 976b32c

Browse files
NO-SNOW: Fix failing test_invalid_connection_parameters_turned_off (#2631)
The failure was caused by boto PythonDeprecationWarning. To avoid if/else logic for checking boto availability I decided to check suffixes of the warnings instead of their types.
1 parent cf563f8 commit 976b32c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/integ/test_connection.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -812,9 +812,13 @@ def test_invalid_connection_parameters_turned_off(conn_cnx):
812812
# TODO: SNOW-2114216 remove filtering once the root cause for deprecation warning is fixed
813813
# Filter out the deprecation warning
814814
filtered_w = [
815-
warning for warning in w if warning.category != DeprecationWarning
815+
warning
816+
for warning in w
817+
if str(warning.category).endswith("DeprecationWarning")
816818
]
817-
assert len(filtered_w) == 0
819+
assert (
820+
len(filtered_w) == 0
821+
), f"Unexpected warnings {[f.message for f in filtered_w]}"
818822

819823

820824
def test_invalid_connection_parameters_only_warns(conn_cnx):

0 commit comments

Comments
 (0)