code: def app_config(monkeypatch_session: pytest.MonkeyPatch) -> AppConfig:
      app_config = AppConfig.from_env()
      if (
          "test" not in app_config.cache.mongo_database
          or "test" not in app_config.queue.mongo_database
      ):
          raise ValueError(
              "Test must be launched on a test mongo database"
          )
      return app_config
  
file_path: datasets-server/services/sse-api/tests/conftest.py
imports: import asyncio
  from collections.abc import Iterator
  import pytest
  from environs import Env
  from libcommon.constants import CACHE_COLLECTION_RESPONSES
  from libcommon.resources import CacheMongoResource
  from libcommon.simple_cache import CachedResponseDocument, _clean_cache_database
  from sse_api.config import AppConfig
label_desc: Use image node_id 2 for calling a global function with example usage: app_config(monkeypatch_session) and returns: app_config