@testing.fixture
def characteristic_fixture(self):

    class FooCharacteristic(characteristics.ConnectionCharacteristic):
        transactional = True

        def reset_characteristic(self, dialect, dbapi_conn):
            dialect.reset_foo(dbapi_conn)

        def set_characteristic(self, dialect, dbapi_conn, value):
            dialect.set_foo(dbapi_conn, value)

        def get_characteristic(self, dialect, dbapi_conn):
            return dialect.get_foo(dbapi_conn)

    class FooDialect(default.DefaultDialect):
        connection_characteristics = util.immutabledict({'foo': FooCharacteristic()})

        def reset_foo(self, dbapi_conn):
            dbapi_conn.foo = 'original_value'

        def set_foo(self, dbapi_conn, value):
            dbapi_conn.foo = value

        def get_foo(self, dbapi_conn):
            return dbapi_conn.foo
    connection = mock.Mock()

    def creator():
        connection.foo = 'original_value'
        return connection
    pool = _pool.SingletonThreadPool(creator=creator)
    u = url.make_url('foo://')
    return (base.Engine(pool, FooDialect(), u), connection)
@testing.fixture
def characteristic_fixture(self):

    class FooCharacteristic(characteristics.ConnectionCharacteristic):
        transactional = True

        def reset_characteristic(self, dialect, dbapi_conn):
            dialect.reset_foo(dbapi_conn)

        def set_characteristic(self, dialect, dbapi_conn, value):
            dialect.set_foo(dbapi_conn, value)

        def get_characteristic(self, dialect, dbapi_conn):
            return dialect.get_foo(dbapi_conn)

    class FooDialect(default.DefaultDialect):
        connection_characteristics = util.immutabledict({'foo': FooCharacteristic()})

        def reset_foo(self, dbapi_conn):
            dbapi_conn.foo = 'original_value'

        def set_foo(self, dbapi_conn, value):
            dbapi_conn.foo = value

        def get_foo(self, dbapi_conn):
            return dbapi_conn.foo
    connection = mock.Mock()

    def creator():
        connection.foo = 'original_value'
        return connection
    pool = _pool.SingletonThreadPool(creator=creator)
    u = url.make_url('foo://')
    return (base.Engine(pool, FooDialect(), u), connection)