Exemplo n.º 1
0
def get_env(key="_test", db_url=None):
    if db_url is None:
        db_url = get_tmp_sqlite_db_url()
    env = Environment(key=key, metadata_storage=db_url)
    env.add_module(core)
    env.add_schema(Customer)
    env.add_schema(Metric)
    return env
Exemplo n.º 2
0
def make_test_env(**kwargs) -> Environment:
    if "metadata_storage" not in kwargs:
        url = get_tmp_sqlite_db_url()
        metadata_storage = Storage.from_url(url)
        kwargs["metadata_storage"] = metadata_storage
    env = Environment(settings=SnapflowSettings(abort_on_function_error=True), **kwargs)
    test_module = SnapflowModule(
        "_test",
    )
    for schema in [TestSchema1, TestSchema2, TestSchema3, TestSchema4]:
        env.add_schema(schema)
    env.add_module(test_module)
    return env
def get_env():
    env = Environment(metadata_storage="sqlite://")
    env.add_module(core)
    env.add_schema(Customer)
    env.add_schema(Metric)
    return env