code: def test_invalid_impersonation() -> None:
      """
      Test ``get_url_for_impersonation`` method when driver == foobar.
  
      The method raises an exception because impersonation is not supported
      for drill+foobar.
      """
      from sqlalchemy.engine.url import URL
  
      from superset.db_engine_specs.drill import DrillEngineSpec
      from superset.db_engine_specs.exceptions import (
          SupersetDBAPIProgrammingError,
      )
  
      url = URL.create("drill+foobar")
      username = "DoAsUser"
  
      with pytest.raises(SupersetDBAPIProgrammingError):
          DrillEngineSpec.get_url_for_impersonation(url, True, username)
  
file_path: superset/tests/unit_tests/db_engine_specs/test_drill.py
imports: from datetime import datetime
  from typing import Optional
  import pytest
  from sqlalchemy.engine.url import make_url
  from tests.unit_tests.db_engine_specs.utils import assert_convert_dttm
  from tests.unit_tests.fixtures.common import dttm
label_desc: Use image node_id 4 for calling a global function with example usage: test_invalid_impersonation() without return types