code: def test_check_sqlalchemy_uri(
      sqlalchemy_uri: str, error: bool, error_message: Optional[str]
  ):
      with app.app_context():
          if error:
              with pytest.raises(SupersetSecurityException) as excinfo:
                  check_sqlalchemy_uri(make_url(sqlalchemy_uri))
                  assert str(excinfo.value) == error_message
          else:
              check_sqlalchemy_uri(make_url(sqlalchemy_uri))
  
imports: from typing import Optional
  import pytest
  from sqlalchemy.engine.url import make_url
  from superset.exceptions import SupersetSecurityException
  from superset.security.analytics_db_safety import check_sqlalchemy_uri
  from tests.integration_tests.test_app import app
label_desc: Use image node_id 1 for calling a global function with example usage: test_check_sqlalchemy_uri(sqlalchemy_uri, error, error_message) without return types