diff --git a/initdb.py b/initdb.py index b7dbe01e5..918d8933c 100644 --- a/initdb.py +++ b/initdb.py @@ -208,8 +208,10 @@ def finished_database_for_testing(testcase): """ Called when a testcase has finished using the database, indicating that any changes should be discarded. """ + testcases[testcase]['savepoint'].rollback() testcases[testcase]['savepoint'].__exit__(True, None, None) - testcases[testcase]['atomic'].__exit__(True, None, None) + + testcases[testcase]['transaction'].__exit__(True, None, None) def setup_database_for_testing(testcase, with_storage=False, force_rebuild=False): """ Called when a testcase has started using the database, indicating that @@ -243,8 +245,8 @@ def setup_database_for_testing(testcase, with_storage=False, force_rebuild=False # Create a savepoint for the testcase. testcases[testcase] = {} - testcases[testcase]['atomic'] = db.manual_commit() - testcases[testcase]['atomic'].__enter__() + testcases[testcase]['transaction'] = db.transaction() + testcases[testcase]['transaction'].__enter__() testcases[testcase]['savepoint'] = db.savepoint() testcases[testcase]['savepoint'].__enter__()