def setUp(self):
    db.session.rollback()
self.trans = db.session.begin(subtransactions=True)

def tearDown(self):
    self.trans.rollback()
db.session.begin()
Flask-SQLAlchemy integration tests can't find a way to rollback changes