From ad23f3b068554aaf21d71b6f288ec0cf3fe81696 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 19 May 2008 22:35:32 +0000 Subject: [PATCH] - zoomark/zoomark_orm seem to work with pool_threadlocal turned off, [ticket:1050] becomes WORKSFORME - fixed probably errenous unique=True checkin on unitofwork.py --- lib/sqlalchemy/pool.py | 1 - test/orm/unitofwork.py | 2 +- test/profiling/zoomark.py | 10 +++++----- test/profiling/zoomark_orm.py | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/sqlalchemy/pool.py b/lib/sqlalchemy/pool.py index 7a9932e8b3..a94cd28f38 100644 --- a/lib/sqlalchemy/pool.py +++ b/lib/sqlalchemy/pool.py @@ -118,7 +118,6 @@ class Pool(object): """ def __init__(self, creator, recycle=-1, echo=None, use_threadlocal=False, reset_on_return=True, listeners=None): - self.logger = log.instance_logger(self, echoflag=echo) # the WeakValueDictionary works more nicely than a regular dict of # weakrefs. the latter can pile up dead reference objects which don't diff --git a/test/orm/unitofwork.py b/test/orm/unitofwork.py index 926dc6ff07..c91c9854c3 100644 --- a/test/orm/unitofwork.py +++ b/test/orm/unitofwork.py @@ -835,7 +835,7 @@ class DefaultTest(_base.MappedTest): dt = Table('default_t', metadata, Column('id', Integer, primary_key=True, test_needs_autoincrement=True), - Column('hoho', hohotype, server_default=str(hohoval), unique=True), + Column('hoho', hohotype, server_default=str(hohoval)), Column('counter', Integer, default=sa.func.char_length("1234567")), Column('foober', String(30), default="im foober", onupdate="im the update")) diff --git a/test/profiling/zoomark.py b/test/profiling/zoomark.py index 69f236ef19..e0d696ae4e 100644 --- a/test/profiling/zoomark.py +++ b/test/profiling/zoomark.py @@ -35,7 +35,7 @@ class ZooMarkTest(TestBase): creator = testing.db.pool._creator recorder = lambda: dbapi_session.recorder(creator()) - engine = engines.testing_engine(options={'creator':recorder, 'pool_threadlocal':True}) # TODO: shouldnt need threadlocal pool + engine = engines.testing_engine(options={'creator':recorder}) metadata = MetaData(engine) def test_baseline_1_create_tables(self): @@ -317,7 +317,7 @@ class ZooMarkTest(TestBase): global metadata player = lambda: dbapi_session.player() - engine = create_engine('postgres:///', creator=player, pool_threadlocal=True) # TODO: shouldnt need threadlocal pool + engine = create_engine('postgres:///', creator=player) metadata = MetaData(engine) @profiling.function_call_count(3230, {'2.4': 1796}) @@ -336,15 +336,15 @@ class ZooMarkTest(TestBase): def test_profile_3_properties(self): self.test_baseline_3_properties() - @profiling.function_call_count(18119, {'2.4': 10549}) + @profiling.function_call_count(17098, {'2.4': 10549}) def test_profile_4_expressions(self): self.test_baseline_4_expressions() - @profiling.function_call_count(1617, {'2.4': 1032}) + @profiling.function_call_count(1523, {'2.4': 1032}) def test_profile_5_aggregates(self): self.test_baseline_5_aggregates() - @profiling.function_call_count(1882, {'2.4': 1048}) + @profiling.function_call_count(2054, {'2.4': 1048}) def test_profile_6_editing(self): self.test_baseline_6_editing() diff --git a/test/profiling/zoomark_orm.py b/test/profiling/zoomark_orm.py index 98b616efa5..f347be52cc 100644 --- a/test/profiling/zoomark_orm.py +++ b/test/profiling/zoomark_orm.py @@ -38,7 +38,7 @@ class ZooMarkTest(TestBase): recorder = lambda: dbapi_session.recorder(creator()) engine = engines.testing_engine(options={'creator':recorder}) metadata = MetaData(engine) - session = sessionmaker(bind=engine)() # the recorder seems to have a dependency on being bound to the engine here + session = sessionmaker()() def test_baseline_1_create_tables(self): zoo = Table('Zoo', metadata, -- 2.47.3