code: def test_automain_imported(ex):
      main_called = [False]
  
      with patch.object(sys, "argv", ["test.py"]):
  
          @ex.automain
          def foo():
              main_called[0] = True
  
          assert "foo" in ex.commands
          assert ex.commands["foo"] == foo
          assert ex.default_command == "foo"
          assert main_called[0] is False
  
imports: from sacred import Ingredient
  from mock import patch
  import pytest
  import sys
  from sacred import cli_option
  from sacred import host_info_gatherer
  from sacred.experiment import Experiment
  from sacred.utils import apply_backspaces_and_linefeeds, ConfigAddedError, SacredError
label_desc: Use image node_id 3 for calling a global function with example usage: test_automain_imported(ex) without return types