

@testing.requires.sqlite
def test_wrapper_hooks(self):

    def get_dialect_cls(url):
        url.drivername = 'sqlite'
        return url.get_dialect()
    global WrapperFactory
    WrapperFactory = Mock()
    WrapperFactory.get_dialect_cls.side_effect = get_dialect_cls
    registry.register('wrapperdialect', __name__, 'WrapperFactory')
    from sqlalchemy.dialects import sqlite
    e = create_engine('wrapperdialect://')
    eq_(e.dialect.name, 'sqlite')
    assert isinstance(e.dialect, sqlite.dialect)
    eq_(WrapperFactory.mock_calls, [call.get_dialect_cls(url.make_url('sqlite://')), call.engine_created(e)])

dataset/ETHPy150Open zzzeek/sqlalchemy/test/engine/test_parseconnect.py TestRegNewDBAPI.test_wrapper_hooks/original