code: def test_invalid_type(capsys, single_with_trials):
      """Test that invalid type leads to correct error message"""
      with pytest.raises(SystemExit):
          returncode = orion.core.cli.main(
              [
                  "plot",
                  "regret",
                  "--name",
                  "test_single_exp",
                  "--type",
                  "boom",
              ]
          )
  
      captured = capsys.readouterr().err
  
      assert (
          "-t/--type: invalid choice: 'boom' (choose from 'png'"
          in captured
      )
  
imports: import random
  import pytest
  import orion.core.cli
  import orion.plotting.backend_plotly
  from orion.core.cli.plot import IMAGE_TYPES, VALID_TYPES
  from orion.plotting.base import SINGLE_EXPERIMENT_PLOTS
  from orion.storage.base import setup_storage
  from orion.testing import AssertNewFile
label_desc: Use image node_id 6 for calling a global function with example usage: test_invalid_type(capsys, single_with_trials) without return types