17 lines
711 B
Python
17 lines
711 B
Python
|
|
"""Shared test path setup.
|
||
|
|
|
||
|
|
The task-execution fixture proofs import the sibling `secrets-engine` source
|
||
|
|
checkout. Its root is located the same way as in test_task_execution_plan.py:
|
||
|
|
SECRETS_ENGINE_SOURCE_ROOT, defaulting to ../secrets-engine. Without this, the
|
||
|
|
proofs only import when an earlier test has already loaded the package, so
|
||
|
|
running one file alone fails.
|
||
|
|
"""
|
||
|
|
import os
|
||
|
|
import sys
|
||
|
|
from pathlib import Path
|
||
|
|
|
||
|
|
_SECRETS = Path(os.environ.get('SECRETS_ENGINE_SOURCE_ROOT',
|
||
|
|
str(Path(__file__).resolve().parents[2] / 'secrets-engine')))
|
||
|
|
if (_SECRETS / 'src' / 'secrets_engine').is_dir() and str(_SECRETS / 'src') not in sys.path:
|
||
|
|
sys.path.insert(0, str(_SECRETS / 'src'))
|