MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / test_poolargs

Method test_poolargs

test/engine/test_parseconnect.py:821–856  ·  view source on GitHub ↗

test that connection pool args make it thru

(self)

Source from the content-addressed store, hash-verified

819 assert repr(e2) == "Engine(mysql+mysqldb://scott:***@localhost/test)"
820
821 def test_poolargs(self):
822 """test that connection pool args make it thru"""
823
824 e = create_engine(
825 "postgresql+psycopg2://",
826 creator=None,
827 pool_recycle=50,
828 echo_pool=None,
829 module=mock_dbapi,
830 _initialize=False,
831 )
832 assert e.pool._recycle == 50
833
834 # these args work for QueuePool
835
836 e = create_engine(
837 "postgresql+psycopg2://",
838 max_overflow=8,
839 pool_timeout=60,
840 poolclass=tsa.pool.QueuePool,
841 module=mock_dbapi,
842 _initialize=False,
843 )
844
845 # but not SingletonThreadPool
846
847 assert_raises(
848 TypeError,
849 create_engine,
850 "sqlite://",
851 max_overflow=8,
852 pool_timeout=60,
853 poolclass=tsa.pool.SingletonThreadPool,
854 module=mock_sqlite_dbapi,
855 _initialize=False,
856 )
857
858 @testing.combinations(True, False)
859 def test_password_object_str(self, creator):

Callers

nothing calls this directly

Calls 2

create_engineFunction · 0.90
assert_raisesFunction · 0.90

Tested by

no test coverage detected