code: def test_plot_wrong_metric_type(tmp_dir, scm, dvc, run_copy_metrics):
      tmp_dir.gen("metric_t.txt", "some text")
      run_copy_metrics(
          "metric_t.txt",
          "metric.txt",
          plots_no_cache=["metric.txt"],
          name="copy-metric",
          commit="add text metric",
      )
  
      result = dvc.plots.show(
          targets=["metric.txt"], onerror=onerror_collect
      )
      assert isinstance(
          get_plot(
              result, "workspace", file="metric.txt", endkey="error"
          ),
          PlotMetricTypeError,
      )
  
imports: import json
  import os
  import pytest
  from dvc.cli import main
  from dvc.dvcfile import PROJECT_FILE
  from dvc.exceptions import OverlappingOutputPathsError
  from dvc.repo import Repo
  from dvc.repo.plots import PlotMetricTypeError, onerror_collect
  from dvc.utils.fs import remove
  from dvc.utils.serialize import EncodingError, YAMLFileCorruptedError, modify_yaml
  from tests.utils.plots import get_plot
label_desc: Use image node_id 3 for calling a global function with example usage: test_plot_wrong_metric_type(tmp_dir, scm, dvc, run_copy_metrics) without return types