import os os.environ['DB_ENV'] = 'test' import sys import pytest # Ensure backend root is in sys.path for imports like 'config.paths' sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) @pytest.fixture(scope="session", autouse=True) def set_test_db_env(): os.environ['DB_ENV'] = 'test'