code: def handler(request):
      image_name = "mindsdb/postgres-handler-test"
      docker_client = docker.from_env()
      if request.param["ssl"]:
          command = "-c ssl=on -c ssl_cert_file=/var/lib/.postgresql/server.crt -c ssl_key_file=/var/lib/.postgresql/server.key"
      else:
          command = None
      container = None
      try:
          container = docker_client.containers.run(
              image_name,
              command=command,
              detach=True,
              environment={"POSTGRES_PASSWORD": "supersecret"},
              ports={"5432/tcp": 15432},
          )
          waitReadiness(container)
      except Exception as e:
          if container is not None:
              container.kill()
          raise e
  
      handler = PostgresHandler(
          "test_postgres_handler", **HANDLER_KWARGS
      )
      yield handler
      container.kill()
      docker_client.close()
  
file_path: mindsdb/tests/handler_tests/test_postgres_handler.py
imports: import time
  import pytest
  import docker
  from mindsdb.integrations.handlers.postgres_handler.postgres_handler import PostgresHandler
  from mindsdb.api.executor.data_types.response_type import RESPONSE_TYPE
label_desc: Use image node_id 2 for calling a global function with example usage: handler(request) without return types