Skip to content

Commit 3f93782

Browse files
authored
Merge pull request #1650 from weaviate/fix/test-flake
Use client context manager to avoid warning flakes
2 parents c8e1ab1 + 3ab1e58 commit 3f93782

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

mock_tests/test_collection.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,14 @@ def handler(request: Request) -> Response:
9494
weaviate_auth_mock.expect_request("/v1/schema").respond_with_handler(handler)
9595

9696
with pytest.warns(UserWarning) as recwarn:
97-
weaviate.connect_to_local(
97+
with weaviate.connect_to_local(
9898
port=MOCK_PORT,
9999
host=MOCK_IP,
100100
grpc_port=MOCK_PORT_GRPC,
101101
headers={header_name: "Bearer " + bearer_token},
102102
auth_credentials=wvc.init.Auth.api_key("key"),
103-
)
104-
assert str(recwarn[0].message).startswith("Auth004")
103+
) as _:
104+
assert str(recwarn[0].message).startswith("Auth004")
105105

106106

107107
def test_auth_header_with_catchall_proxy(

0 commit comments

Comments
 (0)