Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pipes] docs: add tests for pipes code snippets #17184

Merged
merged 2 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def subprocess_asset(
):
cmd = [
shutil.which("python"),
file_relative_path(__file__, "multi_asset_external_code.py"),
file_relative_path(__file__, "external_code.py"),
]
return pipes_subprocess_client.run(command=cmd, context=context).get_results()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def subprocess_asset(
):
cmd = [
shutil.which("python"),
file_relative_path(__file__, "multi_asset_external_code.py"),
file_relative_path(__file__, "external_code.py"),
]
return pipes_subprocess_client.run(command=cmd, context=context).get_results()

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import pytest

from docs_snippets.guides.dagster.dagster_pipes.subprocess.part_1.dagster_code import (
defs as part_1_defs,
)
from docs_snippets.guides.dagster.dagster_pipes.subprocess.part_2.step_1.dagster_code import (
defs as part_2_step_1_defs,
)
from docs_snippets.guides.dagster.dagster_pipes.subprocess.part_2.step_2.dagster_code import (
defs as part_2_step_2_defs,
)
from docs_snippets.guides.dagster.dagster_pipes.subprocess.part_2.step_3_check.dagster_code import (
defs as part_2_step_3_check_defs,
)
from docs_snippets.guides.dagster.dagster_pipes.subprocess.part_2.step_3_materialization.dagster_code import (
defs as part_2_step_3_materialization_defs,
)
from docs_snippets.guides.dagster.dagster_pipes.subprocess.with_asset_check.dagster_code import (
defs as with_asset_check_defs,
)
from docs_snippets.guides.dagster.dagster_pipes.subprocess.with_extras_env.dagster_code import (
defs as with_extras_env_defs,
)
from docs_snippets.guides.dagster.dagster_pipes.subprocess.with_multi_asset.dagster_code import (
defs as with_multi_asset_defs,
)


@pytest.mark.parametrize(
"defs",
[
part_1_defs,
part_2_step_1_defs,
part_2_step_2_defs,
part_2_step_3_check_defs,
part_2_step_3_materialization_defs,
with_asset_check_defs,
with_extras_env_defs,
with_multi_asset_defs,
],
)
def test_execute(defs):
job_def = defs.get_implicit_global_asset_job_def()
result = job_def.execute_in_process()
assert result.success