

def test_engine_from_config_custom(self):
    from sqlalchemy import util
    tokens = __name__.split('.')

    class MyDialect(MockDialect):
        engine_config_types = {
            'foobar': int,
            'bathoho': util.bool_or_str('force'),
        }

        def __init__(self, foobar=None, bathoho=None, **kw):
            self.foobar = foobar
            self.bathoho = bathoho
    global dialect
    dialect = MyDialect
    registry.register('mockdialect.barb', '.'.join(tokens[0:(- 1)]), tokens[(- 1)])
    config = {
        'sqlalchemy.url': 'mockdialect+barb://',
        'sqlalchemy.foobar': '5',
        'sqlalchemy.bathoho': 'false',
    }
    e = engine_from_config(config, _initialize=False)
    eq_(e.dialect.foobar, 5)
    eq_(e.dialect.bathoho, False)

dataset/ETHPy150Open zzzeek/sqlalchemy/test/engine/test_parseconnect.py CreateEngineTest.test_engine_from_config_custom/original