code: def test_import_object():
      module = import_object("sphinx")
      assert module.__name__ == "sphinx"
  
      module = import_object("sphinx.application")
      assert module.__name__ == "sphinx.application"
  
      obj = import_object("sphinx.application.Sphinx")
      assert obj.__name__ == "Sphinx"
  
      with pytest.raises(ExtensionError) as exc:
          import_object("sphinx.unknown_module")
      assert (
          exc.value.args[0] == "Could not import sphinx.unknown_module"
      )
  
      with pytest.raises(ExtensionError) as exc:
          import_object("sphinx.unknown_module", "my extension")
      assert exc.value.args[0] == (
          "Could not import sphinx.unknown_module "
          "(needed for my extension)"
      )
  
file_path: sphinx/tests/test_util/test_util.py
imports: import os
  import tempfile
  import pytest
  from sphinx.errors import ExtensionError
  from sphinx.util import encode_uri, ensuredir, import_object, parselinenos
label_desc: Use image node_id 3 for calling a global function with example usage: test_import_object() without return types