langchain/tests/integration_tests/vectorstores
sergerdn 6dc86ad48f
feat: add pytest-vcr for recording HTTP interactions in integration tests (#2445)
Using `pytest-vcr` in integration tests has several benefits. Firstly,
it removes the need to mock external services, as VCR records and
replays HTTP interactions on the fly. Secondly, it simplifies the
integration test setup by eliminating the need to set up and tear down
external services in some cases. Finally, it allows for more reliable
and deterministic integration tests by ensuring that HTTP interactions
are always replayed with the same response.
Overall, `pytest-vcr` is a valuable tool for simplifying integration
test setup and improving their reliability

This commit adds the `pytest-vcr` package as a dependency for
integration tests in the `pyproject.toml` file. It also introduces two
new fixtures in `tests/integration_tests/conftest.py` files for managing
cassette directories and VCR configurations.

In addition, the
`tests/integration_tests/vectorstores/test_elasticsearch.py` file has
been updated to use the `@pytest.mark.vcr` decorator for recording and
replaying HTTP interactions.

Finally, this commit removes the `documents` fixture from the
`test_elasticsearch.py` file and replaces it with a new fixture defined
in `tests/integration_tests/vectorstores/conftest.py` that yields a list
of documents to use in any other tests.

This also includes my second attempt to fix issue :
https://github.com/hwchase17/langchain/issues/2386

Maybe related https://github.com/hwchase17/langchain/issues/2484
2023-04-07 07:28:57 -07:00
..
cassettes/test_elasticsearch feat: add pytest-vcr for recording HTTP interactions in integration tests (#2445) 2023-04-07 07:28:57 -07:00
docker-compose fix: elasticsearch (#2402) 2023-04-05 06:51:32 -07:00
fixtures fix: elasticsearch (#2402) 2023-04-05 06:51:32 -07:00
__init__.py add few shot example (#148) 2022-11-19 20:32:45 -08:00
conftest.py feat: add pytest-vcr for recording HTTP interactions in integration tests (#2445) 2023-04-07 07:28:57 -07:00
fake_embeddings.py Propagate "filter" arg in Chroma similarity_search (#1869) 2023-03-22 19:40:10 -07:00
test_atlas.py Harrison/atlas db (#1315) 2023-02-26 22:11:38 -08:00
test_chroma.py Propagate "filter" arg in Chroma similarity_search (#1869) 2023-03-22 19:40:10 -07:00
test_deeplake.py Deep Lake upgrade to include attribute search, distance metrics, returning scores and MMR (#2455) 2023-04-06 12:47:33 -07:00
test_elasticsearch.py feat: add pytest-vcr for recording HTTP interactions in integration tests (#2445) 2023-04-07 07:28:57 -07:00
test_faiss.py Allow k to be higher than doc size in max_marginal_relevance_search (#1187) 2023-02-20 16:39:13 -08:00
test_milvus.py Harrison/milvus (#856) 2023-02-02 22:05:47 -08:00
test_opensearch.py Add Support for OpenSearch Vector database (#1191) 2023-02-20 18:39:34 -08:00
test_pgvector.py Removed duplicate BaseModel dependencies (#2471) 2023-04-06 12:45:16 -07:00
test_pinecone.py use namespace argument in Pinecone constructor (#1757) 2023-03-18 19:55:38 -07:00
test_qdrant.py Qdrant update to 1.1.1 & docs polishing (#2388) 2023-04-04 06:48:21 -07:00
test_redis.py feat: add redisearch vectorstore (#1307) 2023-03-14 18:06:03 -07:00