File size: 652 Bytes
e9dac18
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
"""Make the stratum package importable when pytest is started from the repository root."""

import sys
from pathlib import Path

ROOT = Path(__file__).resolve().parents[1]
if str(ROOT) not in sys.path:
    sys.path.insert(0, str(ROOT))
# Inside the repository this bundle is several levels below the orchestrator package, so look for an
# ancestor that carries src/lingologos_orchestrator instead of assuming the bundle sits at the root.
for _parent in ROOT.parents:
    _candidate = _parent / "src"
    if (_candidate / "lingologos_orchestrator").is_dir() and str(_candidate) not in sys.path:
        sys.path.insert(0, str(_candidate))
        break