]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
fix the scoping here
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 13 Jul 2013 20:36:54 +0000 (16:36 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 13 Jul 2013 20:37:10 +0000 (16:37 -0400)
test/engine/test_pool.py

index 3e0188bd70899d6e741d6759e08efa917457d48a..d504473b4a059b2afde26c3f3dda3628a4282d60 100644 (file)
@@ -887,7 +887,7 @@ class QueuePoolTest(PoolTestBase):
                 p = pool.QueuePool(creator=creator,
                                    pool_size=2, timeout=timeout,
                                    max_overflow=max_overflow)
-                def waiter(p):
+                def waiter(p, timeout, max_overflow):
                     success_key = (timeout, max_overflow)
                     conn = p.connect()
                     time.sleep(.5)
@@ -899,7 +899,8 @@ class QueuePoolTest(PoolTestBase):
                 c2 = p.connect()
 
                 for i in range(2):
-                    t = threading.Thread(target=waiter, args=(p, ))
+                    t = threading.Thread(target=waiter,
+                                    args=(p, timeout, max_overflow))
                     t.setDaemon(True)  # so the tests dont hang if this fails
                     t.start()
 
@@ -907,6 +908,7 @@ class QueuePoolTest(PoolTestBase):
                 c2.invalidate()
                 p2 = p._replace()
         time.sleep(1)
+
         eq_(len(success), 12, "successes: %s" % success)
 
     @testing.requires.threading_with_mock