def test_warning_in_transaction(self):
    eng = testing_engine()
    c1 = eng.connect()
    with expect_warnings('Connection is already established with a Transaction; setting isolation_level may implicitly rollback or commit the existing transaction, or have no effect until next transaction'):
        with c1.begin():
            c1 = c1.execution_options(isolation_level=self._non_default_isolation_level())
            eq_(eng.dialect.get_isolation_level(c1.connection), self._non_default_isolation_level())
    eq_(eng.dialect.get_isolation_level(c1.connection), self._non_default_isolation_level())
def test_warning_in_transaction(self):
    eng = testing_engine()
    c1 = eng.connect()
    with expect_warnings('Connection is already established with a Transaction; setting isolation_level may implicitly rollback or commit the existing transaction, or have no effect until next transaction'):
        with c1.begin():
            c1 = c1.execution_options(isolation_level=self._non_default_isolation_level())
            eq_(eng.dialect.get_isolation_level(c1.connection), self._non_default_isolation_level())
    eq_(eng.dialect.get_isolation_level(c1.connection), self._non_default_isolation_level())