@tests.test
def transaction_block():
    def block(lst):
        if lst:
            lst.append(1)
            return lst
        return []
    test_cache = make_test_cache()
    t = Transaction(test_cache, 'key')
    t(block)
    assert ['interrupt', 1] == test_cache.get('key')[1]
Transaction using IoC.
dataset/ETHPy150Open StyleShare/flask-volatile/volatiletests/transaction.py/transaction_block