code: def test_format_only(self):
      with self.assertRaises(AssertionError):
          metric = CocoPanopticMetric(
              ann_file=self.gt_json_path,
              seg_prefix=self.gt_seg_dir,
              classwise=False,
              nproc=1,
              format_only=True,
              outfile_prefix=None,
          )
  
      outfile_prefix = f"{self.tmp_dir.name}/test"
      metric = CocoPanopticMetric(
          ann_file=self.gt_json_path,
          seg_prefix=self.gt_seg_dir,
          classwise=False,
          nproc=1,
          format_only=True,
          outfile_prefix=outfile_prefix,
      )
      metric.dataset_meta = self.dataset_meta
      metric.process({}, deepcopy(self.data_samples))
      eval_results = metric.evaluate(size=1)
      self.assertDictEqual(eval_results, dict())
      self.assertTrue(osp.exists(f"{self.tmp_dir.name}/test.panoptic"))
      self.assertTrue(
          osp.exists(f"{self.tmp_dir.name}/test.panoptic.json")
      )
  
file_path: mmdetection/tests/test_evaluation/test_metrics/test_coco_panoptic_metric.py
imports: import os
  import os.path
  import tempfile
  import unittest
  from copy import deepcopy
  import mmcv
  import numpy
  import torch
  from mmengine.fileio import dump
  from mmdet.evaluation import INSTANCE_OFFSET, CocoPanopticMetric
label_desc: Use image node_id 8 for calling the TestCocoPanopticMetric obj's underlying member method code with example usage: obj.test_format_only() without return types