Skip to content

The agent engineering platform.

core: fix path test (#28584)

Erick Friisc38b845d7ebd
diff --git a/libs/core/tests/unit_tests/_api/test_path.py b/libs/core/tests/unit_tests/_api/test_path.py
index 89428c7cfc..93896aab11 100644
--- a/libs/core/tests/unit_tests/_api/test_path.py
+++ b/libs/core/tests/unit_tests/_api/test_path.py
@@ -10,7 +10,11 @@ ROOT = HERE.parent.parent.parent
def test_as_import_path() -> None:
"""Test that the path is converted to a LangChain import path."""
# Verify that default paths are correct
- assert path.PACKAGE_DIR == ROOT / "langchain_core"
+
+ # if editable install, check directory structure
+ if path.PACKAGE_DIR == ROOT / "langchain_core":
+ assert path.PACKAGE_DIR == ROOT / "langchain_core"
+
# Verify that as import path works correctly
assert path.as_import_path(HERE, relative_to=ROOT) == "tests.unit_tests._api"
assert (