code: def app_config(monkeypatch_session: 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/admin/tests/conftest.py
imports: from collections.abc import Iterator
  from libcommon.queue import _clean_queue_database
  from libcommon.resources import CacheMongoResource, QueueMongoResource
  from libcommon.simple_cache import _clean_cache_database
  from pytest import MonkeyPatch, TempPathFactory, fixture
  from admin.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