Differential D8684 Diff 40955 examples/docs_snippets/docs_snippets_tests/deploying_tests/test_dask.py
Changeset View
Changeset View
Standalone View
Standalone View
examples/docs_snippets/docs_snippets_tests/deploying_tests/test_dask.py
from dagster import execute_pipeline, file_relative_path, reconstructable | from dagster import execute_pipeline, file_relative_path, reconstructable | ||||
from dagster.core.test_utils import instance_for_test | from dagster.core.test_utils import instance_for_test | ||||
from dagster.utils.yaml_utils import load_yaml_from_globs | from dagster.utils.yaml_utils import load_yaml_from_globs | ||||
from docs_snippets.deploying.dask_hello_world import dask_pipeline # pylint: disable=import-error | from docs_snippets.deploying.dask_hello_world import ( # pylint: disable=import-error | ||||
dask_pipeline, | |||||
) | |||||
def test_dask_pipeline(): | def test_dask_pipeline(): | ||||
with instance_for_test() as instance: | with instance_for_test() as instance: | ||||
run_config = load_yaml_from_globs( | run_config = load_yaml_from_globs( | ||||
file_relative_path(__file__, "../../docs_snippets/deploying/dask_hello_world.yaml") | file_relative_path( | ||||
__file__, | |||||
"../../docs_snippets/deploying/dask_hello_world.yaml", | |||||
) | |||||
) | ) | ||||
result = execute_pipeline( | result = execute_pipeline( | ||||
reconstructable(dask_pipeline), | reconstructable(dask_pipeline), | ||||
run_config=run_config, | run_config=run_config, | ||||
instance=instance, | instance=instance, | ||||
) | ) | ||||
assert result.success | assert result.success | ||||
assert result.result_for_solid("hello_world").output_value() == "Hello, World!" | assert ( | ||||
result.result_for_solid("hello_world").output_value() | |||||
== "Hello, World!" | |||||
) |