def METHOD_NAME(self):
    pool_name = "pool_test_name"
    engine = sqlalchemy.create_engine(
        "sqlite:///:memory:",
        pool_size=5,
        poolclass=QueuePool,
        pool_logging_name=pool_name,
    )
    metrics = self.get_sorted_metrics()
    self.assertEqual(len(metrics), 0)
    with engine.connect():
        with engine.connect():
            self.assert_pool_idle_used_expected(
                pool_name=pool_name, idle=0, used=2
            )
        # After the first connection is closed
        self.assert_pool_idle_used_expected(
            pool_name=pool_name, idle=1, used=1
        )
        # Resume from idle to used
        with engine.connect():
            self.assert_pool_idle_used_expected(
                pool_name=pool_name, idle=0, used=2
            )
    # After the two connections are closed
    self.assert_pool_idle_used_expected(
        pool_name=pool_name, idle=2, used=0
    )