summaryrefslogtreecommitdiff
path: root/test/profiling/pool.py
diff options
context:
space:
mode:
authorJason Kirtland <jek@discorporate.us>2008-01-12 22:03:42 +0000
committerJason Kirtland <jek@discorporate.us>2008-01-12 22:03:42 +0000
commit17d3c8764e020379e54053bca0b0a2bc71d48aa0 (patch)
tree0b46f1ddc57292b8f5bfbc28ab1679230f63e426 /test/profiling/pool.py
parentc194962019d1bc7322e20b82c33aa1bab3bc2a28 (diff)
downloadsqlalchemy-17d3c8764e020379e54053bca0b0a2bc71d48aa0.tar.gz
- testbase is gone, replaced by testenv
- Importing testenv has no side effects- explicit functions provide similar behavior to the old immediate behavior of testbase - testing.db has the configured db - Fixed up the perf/* scripts
Diffstat (limited to 'test/profiling/pool.py')
-rw-r--r--test/profiling/pool.py22
1 files changed, 12 insertions, 10 deletions
diff --git a/test/profiling/pool.py b/test/profiling/pool.py
index de866a18d..92c488382 100644
--- a/test/profiling/pool.py
+++ b/test/profiling/pool.py
@@ -1,4 +1,4 @@
-import testbase
+import testenv; testenv.configure_for_tests()
from sqlalchemy import *
from testlib import *
from sqlalchemy.pool import QueuePool
@@ -9,11 +9,13 @@ class QueuePoolTest(AssertMixin):
global pool
pool = QueuePool(creator = lambda: sqlite.SQLiteDialect.dbapi().connect(':memory:'), pool_size = 3, max_overflow = -1, use_threadlocal = True)
- # the WeakValueDictionary used for the pool's "threadlocal" idea adds 1-6 method calls to each of these.
- # however its just a lot easier stability wise than dealing with a strongly referencing dict of weakrefs.
- # [ticket:754] immediately got opened when we tried a dict of weakrefs, and though the solution there
- # is simple, it still doesn't solve the issue of "dead" weakrefs sitting in the dict taking up space
-
+ # the WeakValueDictionary used for the pool's "threadlocal" idea adds 1-6
+ # method calls to each of these. however its just a lot easier stability
+ # wise than dealing with a strongly referencing dict of weakrefs.
+ # [ticket:754] immediately got opened when we tried a dict of weakrefs,
+ # and though the solution there is simple, it still doesn't solve the
+ # issue of "dead" weakrefs sitting in the dict taking up space
+
@profiling.profiled('pooltest_connect', call_range=(40, 50), always=True)
def test_first_connect(self):
conn = pool.connect()
@@ -27,14 +29,14 @@ class QueuePoolTest(AssertMixin):
conn2 = pool.connect()
return conn2
c2 = go()
-
+
def test_second_samethread_connect(self):
conn = pool.connect()
-
+
@profiling.profiled('pooltest_samethread_connect', call_range=(4, 4), always=True)
def go():
return pool.connect()
c2 = go()
-
+
if __name__ == '__main__':
- testbase.main()
+ testenv.main()