code: def test_metrics_show_markdown(capsys):
      show_metrics(
          metrics={
              "branch_1": {
                  "data": {
                      "metrics.json": {
                          "data": {"b": {"ad": 1, "bc": 2}, "c": 4}
                      }
                  }
              },
              "branch_2": {
                  "data": {
                      "metrics.json": {
                          "data": {"a": 1, "b": {"ad": 3, "bc": 4}}
                      }
                  }
              },
              "branch_3": {"error": YAMLFileCorruptedError("failed")},
          },
          all_branches=True,
          markdown=True,
      )
      out, _ = capsys.readouterr()
      assert out == textwrap.dedent(
          """\
          | Revision   | Path         | a   | b.ad   | b.bc   | c   |
          |------------|--------------|-----|--------|--------|-----|
          | branch_1   | metrics.json | -   | 1      | 2      | 4   |
          | branch_2   | metrics.json | 1   | 3      | 4      | -   |
  
          """
      )
  
imports: import textwrap
  import pytest
  from dvc.compare import diff_table, metrics_table, show_diff, show_metrics
  from dvc.utils.serialize import YAMLFileCorruptedError
label_desc: Use image node_id 25 for calling a global function with example usage: test_metrics_show_markdown(capsys) without return types