def METHOD_NAME(pgconn, waitfn):
    waitfn = getattr(waiting, waitfn)
    pgconn.send_query(b"select 1")
    gen = generators.execute(pgconn)
    pgconn.finish()
    with pytest.raises(psycopg.OperationalError):
        waitfn(gen, pgconn.socket)