sqlalchemy - Rollback Many Transactions between tests in Flask -
sqlalchemy - Rollback Many Transactions between tests in Flask - my tests take long time run , trying rollback transactions between tests instead of dropping , creating tables between tests. the issues in tests multiple commits. edit: how rollback transactions between tests tests run faster here base of operations class used testing. import unittest app import create_app app.core import db test_client import testclient, testresponse class testbase(unittest.testcase): def setup(self): self.app = create_app('testing') self.app_context = self.app.app_context() self.app_context.push() self.app.response_class = testresponse self.app.test_client_class = testclient db.create_all() def teardown(self): db.session.remove() db.drop_all() db.get_engine(self.app).dispose() self.app_context.pop() here effort @ rolling transactions. class testbase(unittest.testcase): @classmeth...