Home / File/ test_standard.py — langchain Source File

test_standard.py — langchain Source File

Architecture documentation for test_standard.py, a python file in the langchain codebase. 4 imports, 0 dependents.

File python CoreAbstractions Serialization 4 imports 1 functions 1 classes

Entity Profile

Dependency Diagram

graph LR
  bdf4516c_1a05_1b4d_2b7d_71842d363ebb["test_standard.py"]
  120e2591_3e15_b895_72b6_cb26195e40a6["pytest"]
  bdf4516c_1a05_1b4d_2b7d_71842d363ebb --> 120e2591_3e15_b895_72b6_cb26195e40a6
  bc46b61d_cfdf_3f6b_a9dd_ac2a328d84b3["langchain_core.embeddings"]
  bdf4516c_1a05_1b4d_2b7d_71842d363ebb --> bc46b61d_cfdf_3f6b_a9dd_ac2a328d84b3
  e85cc09a_55c8_b775_4454_f3a6771761b9["pytest_benchmark.fixture"]
  bdf4516c_1a05_1b4d_2b7d_71842d363ebb --> e85cc09a_55c8_b775_4454_f3a6771761b9
  77801658_6b3a_bc26_7e54_388e5c04807d["langchain_qdrant"]
  bdf4516c_1a05_1b4d_2b7d_71842d363ebb --> 77801658_6b3a_bc26_7e54_388e5c04807d
  style bdf4516c_1a05_1b4d_2b7d_71842d363ebb fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import pytest
from langchain_core.embeddings import Embeddings
from pytest_benchmark.fixture import BenchmarkFixture  # type: ignore[import-untyped]

from langchain_qdrant import QdrantVectorStore


class MockEmbeddings(Embeddings):
    """Mock embeddings for testing."""

    def embed_documents(self, texts: list[str]) -> list[list[float]]:
        """Mock embed_documents method."""
        return [[1.0, 2.0, 3.0] for _ in texts]

    def embed_query(self) -> list[float]:  # type: ignore[override]
        """Mock embed_query method."""
        return [1.0, 2.0, 3.0]


@pytest.mark.benchmark
def test_qdrant_vectorstore_init_time(benchmark: BenchmarkFixture) -> None:
    """Test QdrantVectorStore initialization time."""

    def _init_qdrant_vectorstore() -> None:
        for _ in range(10):
            QdrantVectorStore.from_texts(
                texts=["test"],
                embedding=MockEmbeddings(),
                location=":memory:",
                collection_name="test",
            )

    benchmark(_init_qdrant_vectorstore)

Subdomains

Classes

Dependencies

  • langchain_core.embeddings
  • langchain_qdrant
  • pytest
  • pytest_benchmark.fixture

Frequently Asked Questions

What does test_standard.py do?
test_standard.py is a source file in the langchain codebase, written in python. It belongs to the CoreAbstractions domain, Serialization subdomain.
What functions are defined in test_standard.py?
test_standard.py defines 1 function(s): test_qdrant_vectorstore_init_time.
What does test_standard.py depend on?
test_standard.py imports 4 module(s): langchain_core.embeddings, langchain_qdrant, pytest, pytest_benchmark.fixture.
Where is test_standard.py in the architecture?
test_standard.py is located at libs/partners/qdrant/tests/unit_tests/test_standard.py (domain: CoreAbstractions, subdomain: Serialization, directory: libs/partners/qdrant/tests/unit_tests).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free