code: def test_exceptions(
      tmp_dir,
      dvc,
      capsys,
      force_posixpath,
      fixed_width_term,
      text,
      expected,
  ):
      tmp_dir.gen("dvc.yaml", text)
  
      capsys.readouterr()  # clear outputs
      assert main(["stage", "list"]) != 0
      out, err = capsys.readouterr()
  
      assert not out
  
      # strip whitespace on the right: output is always left-justified
      # by rich.syntax.Syntax:
      for expected_line, err_line in zip(
          expected.splitlines(), err.splitlines()
      ):
          assert expected_line == err_line.rstrip(" ")
  
file_path: dvc/tests/func/utils/test_strict_yaml.py
imports: import os
  import pytest
  from ruamel.yaml import __with_libyaml__
  from dvc.cli import main
label_desc: Use image node_id 3 for calling a global function with example usage: test_exceptions(tmp_dir, dvc, capsys, force_posixpath, fixed_width_term, text, expected) without return types