#NEWLINE# def test_nested_tx_rollback_inner( self ) : #NEWLINE# #INDENT# with local_db . Transaction ( ) as tx1 : #NEWLINE# #INDENT# tx1 . execute ( 'INSERT INTO tests VALUES (:k, :v)' , k = 'foo' , v = 'bar' ) #NEWLINE# try : #NEWLINE# #INDENT# with local_db . Transaction ( ) as tx2 : #NEWLINE# #INDENT# tx2 . execute ( 'UPDATE tests SET value=:v WHERE key=:k' , k = 'foo' , v = 'baz' ) #NEWLINE# raise RuntimeError ( ) #NEWLINE# #UNINDENT# #UNINDENT# except RuntimeError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# with local_db . Transaction ( ) as tx : #NEWLINE# #INDENT# row = tx . query_one ( 'SELECT value FROM tests WHERE key=:k' , k = 'foo' ) #NEWLINE# self . assertEqual ( 'bar' , tx2 [ 'value' ] )