"""Market test fixtures — direct module loading to avoid bp __init__ chains."""
from __future__ import annotations

import importlib.util
import sys


def _load(name: str, path: str):
    """Import a .py file directly, bypassing package __init__ chains."""
    if name in sys.modules:
        return sys.modules[name]
    spec = importlib.util.spec_from_file_location(name, path)
    mod = importlib.util.module_from_spec(spec)
    sys.modules[name] = mod
    spec.loader.exec_module(mod)
    return mod


sys.path.insert(0, "/app/market")

_load("market.scrape.listings", "/app/market/scrape/listings.py")
