From: Mike Bayer Date: Tue, 31 Jul 2007 22:54:07 +0000 (+0000) Subject: - commented out auto-rollback of attributes for now, added [ticket:705] with the... X-Git-Tag: rel_0_4beta1~129 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4ae0ee30225f8bff73892a22145c3b8ed2e60087;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - commented out auto-rollback of attributes for now, added [ticket:705] with the recipe - added "drop_all()" at the start of all unittest runs; see if that helps some of the carwrecks we have --- diff --git a/lib/sqlalchemy/orm/session.py b/lib/sqlalchemy/orm/session.py index d336c57277..b957f822f6 100644 --- a/lib/sqlalchemy/orm/session.py +++ b/lib/sqlalchemy/orm/session.py @@ -178,7 +178,11 @@ class Session(object): pass else: self.transaction = self.transaction.rollback() - attribute_manager.rollback(*self.identity_map.values()) + # TODO: we can rollback attribute values. however + # we would want to expand attributes.py to be able to save *two* rollback points, one to the + # last flush() and the other to when the object first entered the transaction. + # [ticket:705] + #attribute_manager.rollback(*self.identity_map.values()) if self.transaction is None and self.transactional: self.begin() diff --git a/test/testlib/config.py b/test/testlib/config.py index 987832b11c..db58718cea 100644 --- a/test/testlib/config.py +++ b/test/testlib/config.py @@ -178,7 +178,7 @@ def _require(options, file_config): post_configure['require'] = _require def _create_testing_engine(options, file_config): - from sqlalchemy import engine + from sqlalchemy import engine, schema global db, db_type engine_opts = {} if options.serverside: @@ -194,6 +194,10 @@ def _create_testing_engine(options, file_config): db = engine.create_engine(db_uri, **engine_opts) db_type = db.name + print "Dropping existing tables in database: " + db_uri + md = schema.MetaData(db, reflect=True) + md.drop_all() + # decorate the dialect's create_execution_context() method # to produce a wrapper from testlib.testing import ExecutionContextWrapper