@testing.requires.savepoints
def test_savepoint_seven(self):
    users = self.tables.users
    conn = testing.db.connect()
    trans = conn.begin()
    conn.execute(users.insert(), {'user_id': 1, 'user_name': 'name'})
    sp1 = conn.begin_nested()
    conn.execute(users.insert(), {'user_id': 2, 'user_name': 'name2'})
    sp2 = conn.begin_nested()
    conn.execute(users.insert(), {'user_id': 3, 'user_name': 'name3'})
    assert conn.in_transaction()
    trans.close()
    assert (not sp1.is_active)
    assert (not sp2.is_active)
    assert (not trans.is_active)
    assert (conn._transaction is None)
    assert (conn._nested_transaction is None)
    with testing.db.connect() as conn:
        eq_(conn.scalar(select(func.count(1)).select_from(users)), 0)
@testing.requires.savepoints
def test_savepoint_seven(self):
    users = self.tables.users
    conn = testing.db.connect()
    trans = conn.begin()
    conn.execute(users.insert(), {'user_id': 1, 'user_name': 'name'})
    sp1 = conn.begin_nested()
    conn.execute(users.insert(), {'user_id': 2, 'user_name': 'name2'})
    sp2 = conn.begin_nested()
    conn.execute(users.insert(), {'user_id': 3, 'user_name': 'name3'})
    assert conn.in_transaction()
    trans.close()
    assert (not sp1.is_active)
    assert (not sp2.is_active)
    assert (not trans.is_active)
    assert (conn._transaction is None)
    assert (conn._nested_transaction is None)
    with testing.db.connect() as conn:
        eq_(conn.scalar(select(func.count(1)).select_from(users)), 0)