Skip to content

Commit 11803c5

Browse files
NO-SNOW: Fix failing test_invalid_connection_parameters_turned_off (snowflakedb#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 e54936b commit 11803c5

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
@@ -813,9 +813,13 @@ def test_invalid_connection_parameters_turned_off(conn_cnx):
813813
# TODO: SNOW-2114216 remove filtering once the root cause for deprecation warning is fixed
814814
# Filter out the deprecation warning
815815
filtered_w = [
816-
warning for warning in w if warning.category != DeprecationWarning
816+
warning
817+
for warning in w
818+
if str(warning.category).endswith("DeprecationWarning")
817819
]
818-
assert len(filtered_w) == 0
820+
assert (
821+
len(filtered_w) == 0
822+
), f"Unexpected warnings {[f.message for f in filtered_w]}"
819823

820824

821825
def test_invalid_connection_parameters_only_warns(conn_cnx):

0 commit comments

Comments
 (0)