langchain/tests/integration_tests
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
..
chains Add support for intermediate steps to SQLDatabaseSequentialChain (#1583) (#1601) 2023-03-11 15:44:41 -08:00
chat_models (ChatOpenAI) Add model_name to LLMResult.llm_output (#1960) 2023-03-24 08:51:16 -07:00
document_loaders Harrison/msg files (#2375) 2023-04-04 06:48:34 -07:00
embeddings Harrison/llama (#2314) 2023-04-02 14:57:45 -07:00
examples Harrison/msg files (#2375) 2023-04-04 06:48:34 -07:00
llms Add support for rwkv (#2422) 2023-04-06 14:41:06 -07:00
memory Harrison/memory base (#2122) 2023-03-29 10:10:09 -07:00
vectorstores feat: add pytest-vcr for recording HTTP interactions in integration tests (#2445) 2023-04-07 07:28:57 -07:00
__init__.py initial commit 2022-10-24 14:51:15 -07:00
conftest.py feat: add pytest-vcr for recording HTTP interactions in integration tests (#2445) 2023-04-07 07:28:57 -07:00
test_googlesearch_api.py Fix a bug that shows "KeyError 'items'" (#1118) 2023-02-17 13:04:02 -08:00
test_googleserper_api.py Google Search API integration with serper.dev (wrapper, tests, docs, … (#909) 2023-02-15 22:47:17 -08:00
test_ngram_overlap_example_selector.py Harrison/ngram example (#846) 2023-02-02 09:44:42 -08:00
test_nlp_text_splitters.py OptimizedPrompt -- k-shot example choice backed by semantic search (#91) 2022-11-09 21:15:42 -08:00
test_openweathermap.py Add OpenWeatherMap API Tool (#2083) 2023-03-28 12:02:14 -07:00
test_pdf_pagesplitter.py cleanup: unify 3 different pdf loaders, rename PagedPDFSplitter (#1615) 2023-03-13 23:06:50 -07:00
test_serpapi.py move serpapi wrapper (#1199) 2023-02-20 21:15:45 -08:00
test_text_splitter.py Add alternative token-based text splitter (#816) 2023-02-02 19:55:13 -08:00
test_wikipedia_api.py Modify output for wikipedia api wrapper (#2287) 2023-04-02 14:00:27 -07:00
test_wolfram_alpha_api.py Harrison/wolfram alpha (#579) 2023-01-11 05:52:19 -08:00