import sys import os # Ensure the repository root is on Python path so tests can import the package # even if pytest is invoked from a subdirectory or with an altered PYTHONPATH. ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) if ROOT_DIR not in sys.path: sys.path.insert(0, ROOT_DIR)