From d511366dd3d318801b306bc677e1dc9244f11d9b Mon Sep 17 00:00:00 2001 From: James Braza Date: Mon, 22 Jan 2024 14:00:23 -0800 Subject: [PATCH] infra: absolute `EXAMPLE_DIR` path in core unit tests (#16325) If you invoked testing from places besides `core/`, this `EXAMPLE_DIR` path won't work. This PR makes`EXAMPLE_DIR` robust against invocation location --- libs/core/tests/unit_tests/prompts/test_loading.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/core/tests/unit_tests/prompts/test_loading.py b/libs/core/tests/unit_tests/prompts/test_loading.py index afad88766a..59b5d95cb6 100644 --- a/libs/core/tests/unit_tests/prompts/test_loading.py +++ b/libs/core/tests/unit_tests/prompts/test_loading.py @@ -10,7 +10,7 @@ from langchain_core.prompts.few_shot import FewShotPromptTemplate from langchain_core.prompts.loading import load_prompt from langchain_core.prompts.prompt import PromptTemplate -EXAMPLE_DIR = Path("tests/unit_tests/examples").absolute() +EXAMPLE_DIR = (Path(__file__).parent.parent / "examples").absolute() @contextmanager