async def METHOD_NAME(aconn):
    cur = aconn.cursor()
    await ensure_table(cur, sample_tabledef)
    with pytest.raises(e.QueryCanceled) as exc:
        async with cur.copy("copy copy_in from stdin") as copy:
            await copy.write(sample_text)
            raise Exception("nuttengoggenio")
    assert "nuttengoggenio" in str(exc.value)
    assert aconn.info.transaction_status == aconn.TransactionStatus.INERROR