docstr: Test combination of model/visualizer/mode on only 1 epoch as a sanity check before merge.
docstr_tok: ["Test","combination","of","model\/visualizer\/mode","on","only","1","epoch","as","a","sanity","check","before","merge","."]
code: def test_model_visualizer_mode(
      self, model_name, nncf, task, mode, category="shapes", path=""
  ):
      """Test combination of model/visualizer/mode on only 1 epoch as a sanity check before merge."""
      with tempfile.TemporaryDirectory() as project_path:
          # Train test
          datamodule, model, trainer = setup_model_train(
              model_name,
              dataset_path=path,
              project_path=project_path,
              nncf=nncf,
              category=category,
              fast_run=True,
              dataset_task=task,
              visualizer_mode=mode,
          )[1:]
          trainer.test(model=model, datamodule=datamodule)
  
file_path: anomalib/tests/pre_merge/post_processing/test_visualizer.py
imports: import tempfile
  import numpy
  import pytest
  from matplotlib.backends.backend_agg import FigureCanvasAgg
  from anomalib.data import TaskType
  from anomalib.post_processing.visualizer import ImageGrid
  from tests.helpers.dataset import TestDataset
  from tests.helpers.model import setup_model_train
label_desc: Use image node_id 1 for calling the TestVisualizer obj's underlying member method code with example usage: obj.test_model_visualizer_mode(model_name, nncf, task, mode, category, path) without return types