class_docstr: Test the import_optional function.
docstr: Test import_optional correctly replaces module that doesn't exist with MissingDependency.
code: def test_import_optional_module_missing(self):
      """Test import_optional correctly replaces module that doesn't exist with MissingDependency."""
      package = import_optional("alibi.utils.tests.mocked_opt_dep")
      assert isinstance(package, MissingDependency)
      with pytest.raises(ImportError) as err:
          package.__version__  # noqa
      assert "alibi.utils.tests.mocked_opt_dep" in str(err.value)
      assert "pip install alibi[optional-deps]" in str(err.value)
  
      with pytest.raises(ImportError) as err:
          package(0, "test")  # noqa
      assert "alibi.utils.tests.mocked_opt_dep" in str(err.value)
      assert "pip install alibi[optional-deps]" in str(err.value)
  
file_path: alibi/alibi/utils/tests/test_import_optional.py
imports: import pytest
  from alibi.utils.missing_optional_dependency import import_optional, ERROR_TYPES, MissingDependency
label_desc: Use image node_id 5 for calling the TestImportOptional obj's underlying member method code with example usage: obj.test_import_optional_module_missing() without return types