code: def test_setup_dest(
      tmp_path: Path, exist: bool, no_subdir: bool
  ) -> None:
      metadata = Mock(BenchmarkMetadata)
      metadata.run_id = "test_run_id"
      dest = tmp_path / "dest"
      expected = dest if no_subdir else (dest / "test_run_id")
  
      if exist:
          expected.mkdir(parents=True, exist_ok=True)
          with pytest.raises(FileExistsError):
              setup_dest(metadata, dest, no_subdir=no_subdir)
      else:
          expected.parent.mkdir(parents=True, exist_ok=True)
          assert expected == setup_dest(
              metadata, dest, no_subdir=no_subdir
          )
  
imports: from pathlib import Path
  from unittest.mock import Mock
  import pytest
  from benchmark.metadata import BenchmarkMetadata
  from benchmark.paths import setup_dest
label_desc: Use image node_id 1 for calling a global function with example usage: test_setup_dest(tmp_path, exist, no_subdir) without return types