From: Mike Bayer Date: Wed, 6 Mar 2019 13:18:26 +0000 (-0500) Subject: Loosen SingletonThreadPoolTest X-Git-Tag: rel_1_3_1~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb968b6dcd4dd8ce805827202ca55a7ce10fc871;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Loosen SingletonThreadPoolTest This test is non-critical as the SingletonThreadPool is not production-level robust under multithreaded scenarios in any case. Fixes: #4527 Change-Id: Ie19ebd69438c97b2d8adb571f8f1b2c56894f7fb --- diff --git a/test/engine/test_pool.py b/test/engine/test_pool.py index 1aadd477d9..3722ce9b9f 100644 --- a/test/engine/test_pool.py +++ b/test/engine/test_pool.py @@ -15,6 +15,7 @@ from sqlalchemy.testing import eq_ from sqlalchemy.testing import fixtures from sqlalchemy.testing import is_ from sqlalchemy.testing import is_not_ +from sqlalchemy.testing import is_true from sqlalchemy.testing.engines import testing_engine from sqlalchemy.testing.mock import ANY from sqlalchemy.testing.mock import call @@ -1809,7 +1810,9 @@ class SingletonThreadPoolTest(PoolTestBase): threads.append(th) for th in threads: th.join(join_timeout) - eq_(len(p._all_conns), 3) + + lp = len(p._all_conns) + is_true(3 <= lp <= 4) if strong_refs: still_opened = len([c for c in sr if not c.close.call_count])