mirror of
https://github.com/hwchase17/langchain
synced 2024-11-08 07:10:35 +00:00
6dc86ad48f
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 |
||
---|---|---|
.. | ||
chains | ||
chat_models | ||
document_loaders | ||
embeddings | ||
examples | ||
llms | ||
memory | ||
vectorstores | ||
__init__.py | ||
conftest.py | ||
test_googlesearch_api.py | ||
test_googleserper_api.py | ||
test_ngram_overlap_example_selector.py | ||
test_nlp_text_splitters.py | ||
test_openweathermap.py | ||
test_pdf_pagesplitter.py | ||
test_serpapi.py | ||
test_text_splitter.py | ||
test_wikipedia_api.py | ||
test_wolfram_alpha_api.py |