MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_poolargs

Method test_poolargs

test/engine/test_parseconnect.py:834–869  ·  view source on GitHub ↗

test that connection pool args make it thru

(self)

Source from the content-addressed store, hash-verified

832 assert repr(e2) == "Engine(mysql+mysqldb://scott:***@localhost/test)"
833
834 def test_poolargs(self):
835 """test that connection pool args make it thru"""
836
837 e = create_engine(
838 "postgresql+psycopg2://",
839 creator=None,
840 pool_recycle=50,
841 echo_pool=None,
842 module=mock_dbapi,
843 _initialize=False,
844 )
845 assert e.pool._recycle == 50
846
847 # these args work for QueuePool
848
849 e = create_engine(
850 "postgresql+psycopg2://",
851 max_overflow=8,
852 pool_timeout=60,
853 poolclass=tsa.pool.QueuePool,
854 module=mock_dbapi,
855 _initialize=False,
856 )
857
858 # but not SingletonThreadPool
859
860 assert_raises(
861 TypeError,
862 create_engine,
863 "sqlite://",
864 max_overflow=8,
865 pool_timeout=60,
866 poolclass=tsa.pool.SingletonThreadPool,
867 module=mock_sqlite_dbapi,
868 _initialize=False,
869 )
870
871 @testing.combinations(True, False)
872 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