]> 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:36:54 +0000 (16:36 -0400)
test/engine/test_pool.py

index 37c0bfdeb5b089b52d3a9519a1f0b750c6b617ea..94b776e9c84018511e8666405831b32f214860a0 100644 (file)
@@ -889,7 +889,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)
@@ -901,7 +901,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()
 
@@ -909,6 +910,7 @@ class QueuePoolTest(PoolTestBase):
                 c2.invalidate()
                 p2 = p._replace()
         time.sleep(1)
+
         eq_(len(success), 12, "successes: %s" % success)
 
     @testing.requires.threading_with_mock