The docs state that you can use transactions without a context manager, but this is not exactly true because you need to resort to some private methods on Client:
- this file uses the context manager and produces correct output
- this file uses transactions as described by the aforementioned docs and fails the assertion
- this file uses transactions along with calls to
client._push_batch and client._pop_batch and produces correct output
The issue is evident in Client.get_multi and Client.put_multi where transaction and current are None unless a Batch or Transaction has been pushed to the _batch_stack and the only time that happens is when you __enter__ a Batch.
The docs state that you can use transactions without a context manager, but this is not exactly true because you need to resort to some private methods on
Client:client._push_batchandclient._pop_batchand produces correct outputThe issue is evident in
Client.get_multiandClient.put_multiwheretransactionandcurrentareNoneunless aBatchorTransactionhas been pushed to the_batch_stackand the only time that happens is when you__enter__aBatch.