Skip to content

Commit e73fb8a

Browse files
[Async] Apply #2330 to async code
1 parent 6d7575a commit e73fb8a

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

test/integ/aio/test_connection_async.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -928,8 +928,13 @@ async def test_invalid_connection_parameter(db_parameters, name, value, exc_warn
928928
conn = snowflake.connector.aio.SnowflakeConnection(**conn_params)
929929
await conn.connect()
930930
assert getattr(conn, "_" + name) == value
931-
assert len(w) == 1
932-
assert str(w[0].message) == str(exc_warn)
931+
# TODO: SNOW-2114216 remove filtering once the root cause for deprecation warning is fixed
932+
# Filter out the deprecation warning
933+
filtered_w = [
934+
warning for warning in w if warning.category != DeprecationWarning
935+
]
936+
assert len(filtered_w) == 1
937+
assert str(filtered_w[0].message) == str(exc_warn)
933938
finally:
934939
await conn.close()
935940

@@ -955,7 +960,12 @@ async def test_invalid_connection_parameters_turned_off(db_parameters):
955960
await conn.connect()
956961
assert conn._autocommit == conn_params["autocommit"]
957962
assert conn._applucation == conn_params["applucation"]
958-
assert len(w) == 0
963+
# TODO: SNOW-2114216 remove filtering once the root cause for deprecation warning is fixed
964+
# Filter out the deprecation warning
965+
filtered_w = [
966+
warning for warning in w if warning.category != DeprecationWarning
967+
]
968+
assert len(filtered_w) == 0
959969
finally:
960970
await conn.close()
961971

0 commit comments

Comments
 (0)