code: def job_config(monkeypatch_session: MonkeyPatch) -> JobConfig:
      job_config = JobConfig.from_env()
      if (
          "test" not in job_config.cache.mongo_database
          or "test" not in job_config.queue.mongo_database
      ):
          raise ValueError(
              "Test must be launched on a test mongo database"
          )
      return job_config
  
file_path: datasets-server/jobs/cache_maintenance/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, fixture
  from cache_maintenance.config import JobConfig
  from .constants import CI_APP_TOKEN, CI_HUB_ENDPOINT, CI_PARQUET_CONVERTER_APP_TOKEN, CI_PARQUET_CONVERTER_USER
label_desc: Use image node_id 2 for calling a global function with example usage: job_config(monkeypatch_session) and returns: job_config