You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
langchain/libs/core/tests/unit_tests/test_imports.py

16 lines
487 B
Python

import glob
import importlib
from pathlib import Path
def test_importable_all() -> None:
for path in glob.glob("../core/langchain_core/*"):
relative_path = Path(path).parts[-1]
if relative_path.endswith(".typed"):
continue
module_name = relative_path.split(".")[0]
module = importlib.import_module("langchain_core." + module_name)
all_ = getattr(module, "__all__", [])
for cls_ in all_:
getattr(module, cls_)