diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-08-07 12:36:50 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-08-07 12:36:50 -0400 |
| commit | 6fd073b9125fdfb895543a07167c6a4f6026d941 (patch) | |
| tree | 335916535bb4b9dc243c1f7ac6886d244df44269 /test/engine | |
| parent | 3c6ff6adaec23d34f0a91a3889801589b10082e2 (diff) | |
| download | sqlalchemy-6fd073b9125fdfb895543a07167c6a4f6026d941.tar.gz | |
- take out the iterator approach here as it does not support concurrent access
Diffstat (limited to 'test/engine')
| -rw-r--r-- | test/engine/test_pool.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/test/engine/test_pool.py b/test/engine/test_pool.py index 0ad26e890..0c4557d49 100644 --- a/test/engine/test_pool.py +++ b/test/engine/test_pool.py @@ -12,25 +12,26 @@ from sqlalchemy.testing.mock import Mock, call join_timeout = 10 + def MockDBAPI(): def cursor(): - while True: - yield Mock() + return Mock() - def connect(): - while True: - yield Mock(cursor=Mock(side_effect=cursor())) + def connect(*arg, **kw): + return Mock(cursor=Mock(side_effect=cursor)) def shutdown(value): if value: db.connect = Mock(side_effect=Exception("connect failed")) else: - db.connect = Mock(side_effect=connect()) + db.connect = Mock(side_effect=connect) - db = Mock(connect=Mock(side_effect=connect()), - shutdown=shutdown, _shutdown=False) + db = Mock( + connect=Mock(side_effect=connect), + shutdown=shutdown, _shutdown=False) return db + class PoolTestBase(fixtures.TestBase): def setup(self): pool.clear_managers() |
