@contextmanager
def replace_loop(new_loop):

    # setup
    orig = txaio.config.loop
    txaio.config.loop = new_loop

    yield new_loop

    # cleanup
    txaio.config.loop = orig
This is a context-manager that sets the txaio event-loop to the
dataset/ETHPy150Open crossbario/txaio/txaio/testutil.py/replace_loop