def test_no_weaviate_client_instance_provided():
    """Tests that the creation of a Weaviate client within the WeaviateVectorStore constructor works."""
    vector_store = WeaviateVectorStore(
        client_kwargs={"embedded_options": weaviate.embedded.EmbeddedOptions()}
    )

    # Make sure that the vector store is functional by calling some basic methods
    vector_store.add([TextNode(text="Hello world.", embedding=[0.0, 0.0, 0.3])])
    query = VectorStoreQuery(
        query_embedding=[0.3, 0.0, 0.0],
        similarity_top_k=10,
        query_str="test",
        mode=VectorStoreQueryMode.DEFAULT,
    )
    results = vector_store.query(query)
    assert len(results.nodes) == 1
    weaviate_client = vector_store.client
    del vector_store
    assert not weaviate_client.is_connected()  # As the Weaviate client was created within WeaviateVectorStore, it lies in its responsibility to close the connection when it is not longer needed
Tests that the creation of a Weaviate client within the WeaviateVectorStore constructor works.
llama-index-integrations/vector_stores/llama-index-vector-stores-weaviate/tests/test_vector_stores_weaviate.py