Unset Cache in Tests (#7362)

This is impacting other unit tests that use callbacks since the cache is
still set (just empty)
This commit is contained in:
William FH 2023-07-07 11:05:09 -07:00 committed by GitHub
parent 3ce4e46c8c
commit 4e180dc54e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,6 +47,7 @@ def set_cache_and_teardown(request: FixtureRequest) -> Generator[None, None, Non
# Will be run after each test # Will be run after each test
if langchain.llm_cache: if langchain.llm_cache:
langchain.llm_cache.clear() langchain.llm_cache.clear()
langchain.llm_cache = None
else: else:
raise ValueError("Cache not set. This should never happen.") raise ValueError("Cache not set. This should never happen.")