opengrowth-privacy-preservi.../tests/conftest.py

23 lines
741 B
Python

import importlib
import sys
import os
def _load_underscore_alias():
try:
# Ensure repo root is on sys.path so local packages can be discovered
repo_root = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
if repo_root not in sys.path:
sys.path.insert(0, repo_root)
# Import the local underscore package as a normal package so its
# relative imports resolve correctly.
module = importlib.import_module("opengrowth_privacy_preserving_federated_")
sys.modules["opengrowth_privacy_preserving_federated_"] = module
except Exception:
# If the local package cannot be imported for any reason, skip aliasing.
pass
_load_underscore_alias()