@testing.requires.savepoints
def test_begin_nested_trans_close_one(self):
    with testing.db.connect() as connection:
        t1 = connection.begin()
        assert (connection.connection._reset_agent is t1)
        t2 = connection.begin_nested()
        assert (connection.connection._reset_agent is t1)
        assert (connection._nested_transaction is t2)
        assert (connection._transaction is t1)
        t2.close()
        assert (connection._nested_transaction is None)
        assert (connection._transaction is t1)
        assert (connection.connection._reset_agent is t1)
        t1.close()
        assert (connection.connection._reset_agent is None)
    assert (not t1.is_active)
@testing.requires.savepoints
def test_begin_nested_trans_close_one(self):
    with testing.db.connect() as connection:
        t1 = connection.begin()
        assert (connection.connection._reset_agent is t1)
        t2 = connection.begin_nested()
        assert (connection.connection._reset_agent is t1)
        assert (connection._nested_transaction is t2)
        assert (connection._transaction is t1)
        t2.close()
        assert (connection._nested_transaction is None)
        assert (connection._transaction is t1)
        assert (connection.connection._reset_agent is t1)
        t1.close()
        assert (connection.connection._reset_agent is None)
    assert (not t1.is_active)