forked from CopilotKit/CopilotKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconftest.py
More file actions
23 lines (19 loc) · 860 Bytes
/
Copy pathconftest.py
File metadata and controls
23 lines (19 loc) · 860 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"""Pytest config for langroid adapter tests.
Adds the package's ``src/`` to ``sys.path`` so imports like
``from agents.agui_adapter import ...`` resolve identically to the
runtime path used by the FastAPI entry point in ``src/agent_server.py``
(which likewise imports ``agents.agui_adapter``). Keeping these import
paths aligned means a regression in the adapter surfaces in tests the
same way it would at runtime.
"""
from __future__ import annotations
import os
import sys
_PKG_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
_SRC_DIR = os.path.join(_PKG_DIR, "src")
# Include the integration root so the ``tools`` symlink
# (``langroid/tools`` → ``../../shared/python/tools``) is importable.
if _PKG_DIR not in sys.path:
sys.path.insert(0, _PKG_DIR)
if _SRC_DIR not in sys.path:
sys.path.insert(0, _SRC_DIR)