]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- make sure event mechanics have completed before running this test, lower callcount
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 9 Aug 2012 21:38:59 +0000 (17:38 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 9 Aug 2012 21:38:59 +0000 (17:38 -0400)
test/aaa_profiling/test_pool.py

index b55156bf5855fa0daadd904732c7d3dd3a60fc8c..11c356c373a9116cd5bf57e9cbd4f468406234d1 100644 (file)
@@ -21,18 +21,22 @@ class QueuePoolTest(fixtures.TestBase, AssertsExecutionResults):
         pool_module._refs.clear()
 
     def setup(self):
+        # create a throwaway pool which
+        # has the effect of initializing
+        # class-level event listeners on Pool,
+        # if not present already.
+        p1 = QueuePool(creator=self.Connection,
+                         pool_size=3, max_overflow=-1,
+                         use_threadlocal=True)
+        p1.connect()
+
         global pool
         pool = QueuePool(creator=self.Connection,
                          pool_size=3, max_overflow=-1,
                          use_threadlocal=True)
 
 
-    # the callcount on this test seems to vary
-    # based on tests that ran before (particularly py3k),
-    # probably
-    # due to the event mechanics being established
-    # or not already...
-    @profiling.function_call_count(55, variance=.15)
+    @profiling.function_call_count(47, variance=.15)
     def test_first_connect(self):
         conn = pool.connect()