def test_per_connection(self):
    from sqlalchemy.pool import QueuePool
    eng = testing_engine(options=dict(poolclass=QueuePool, pool_size=2, max_overflow=0))
    c1 = eng.connect()
    c1 = c1.execution_options(isolation_level=self._non_default_isolation_level())
    c2 = eng.connect()
    eq_(eng.dialect.get_isolation_level(c1.connection), self._non_default_isolation_level())
    eq_(eng.dialect.get_isolation_level(c2.connection), self._default_isolation_level())
    c1.close()
    c2.close()
    c3 = eng.connect()
    eq_(eng.dialect.get_isolation_level(c3.connection), self._default_isolation_level())
    c4 = eng.connect()
    eq_(eng.dialect.get_isolation_level(c4.connection), self._default_isolation_level())
    c3.close()
    c4.close()
def test_per_connection(self):
    from sqlalchemy.pool import QueuePool
    eng = testing_engine(options=dict(poolclass=QueuePool, pool_size=2, max_overflow=0))
    c1 = eng.connect()
    c1 = c1.execution_options(isolation_level=self._non_default_isolation_level())
    c2 = eng.connect()
    eq_(eng.dialect.get_isolation_level(c1.connection), self._non_default_isolation_level())
    eq_(eng.dialect.get_isolation_level(c2.connection), self._default_isolation_level())
    c1.close()
    c2.close()
    c3 = eng.connect()
    eq_(eng.dialect.get_isolation_level(c3.connection), self._default_isolation_level())
    c4 = eng.connect()
    eq_(eng.dialect.get_isolation_level(c4.connection), self._default_isolation_level())
    c3.close()
    c4.close()