import sys import os # Ensure the repository root is in sys.path when tests run from a test-centric rootdir. repo_root = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)) if repo_root not in sys.path: sys.path.insert(0, repo_root)