From dbda75ec5f98061b87cf616b468232ebc68a9133 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 19 May 2008 15:46:32 +0000 Subject: pool_threadlocal is off by default [ticket:1049] --- test/profiling/zoomark.py | 4 ++-- test/profiling/zoomark_orm.py | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'test/profiling') diff --git a/test/profiling/zoomark.py b/test/profiling/zoomark.py index e2833a712..69f236ef1 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}) + engine = engines.testing_engine(options={'creator':recorder, 'pool_threadlocal':True}) # TODO: shouldnt need threadlocal pool 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) + engine = create_engine('postgres:///', creator=player, pool_threadlocal=True) # TODO: shouldnt need threadlocal pool metadata = MetaData(engine) @profiling.function_call_count(3230, {'2.4': 1796}) diff --git a/test/profiling/zoomark_orm.py b/test/profiling/zoomark_orm.py index 3d69e6f58..98b616efa 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()() + session = sessionmaker(bind=engine)() # the recorder seems to have a dependency on being bound to the engine here def test_baseline_1_create_tables(self): zoo = Table('Zoo', metadata, @@ -66,7 +66,7 @@ class ZooMarkTest(TestBase): Column('AlternateFoodID', Integer), ) metadata.create_all() - + global Zoo, Animal class Zoo(object): def __init__(self, **kwargs): @@ -270,6 +270,7 @@ class ZooMarkTest(TestBase): assert SDZ.Founded == datetime.date(1835, 9, 13), SDZ.Founded def test_baseline_7_drop(self): + session.rollback() metadata.drop_all() # Now, run all of these tests again with the DB-API driver factored out: @@ -305,7 +306,7 @@ class ZooMarkTest(TestBase): def test_profile_4_expressions(self): self.test_baseline_4_expressions() - @profiling.function_call_count(1327) + @profiling.function_call_count(1507) def test_profile_5_aggregates(self): self.test_baseline_5_aggregates() -- cgit v1.2.1