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