Differential D4920 Diff 24623 python_modules/dagster/dagster_tests/core_tests/definitions_tests/test_composition.py
Changeset View
Changeset View
Standalone View
Standalone View
python_modules/dagster/dagster_tests/core_tests/definitions_tests/test_composition.py
Show First 20 Lines • Show All 647 Lines • ▼ Show 20 Lines | ) as record: | ||||
@pipeline | @pipeline | ||||
def _my_pipeline(): | def _my_pipeline(): | ||||
single_input_solid.with_hooks(set()) | single_input_solid.with_hooks(set()) | ||||
single_input_solid.with_hooks(set()) | single_input_solid.with_hooks(set()) | ||||
execute_pipeline(_my_pipeline) | execute_pipeline(_my_pipeline) | ||||
# Note not returning out of the pipe causes warning count to go up to 2 | |||||
assert len(record) == 1 # We should only raise one warning because solids have same name. | assert len(record) == 1 # We should only raise one warning because solids have same name. | ||||
with pytest.warns( | with pytest.warns( | ||||
UserWarning, | UserWarning, | ||||
match=( | match=( | ||||
r"While in @pipeline context '_my_pipeline', received an uninvoked solid " | r"While in @pipeline context '_my_pipeline', received an uninvoked solid " | ||||
r"'single_input_solid'\.\nProvided hook definitions: \['a_hook'\]\." | r"'single_input_solid'\.\nProvided hook definitions: \['a_hook'\]\." | ||||
), | ), | ||||
Show All 29 Lines | ) as record: | ||||
foo = single_input_solid.alias("foo") | foo = single_input_solid.alias("foo") | ||||
bar = single_input_solid.alias("bar") | bar = single_input_solid.alias("bar") | ||||
foo_tag = foo.tag({}) | foo_tag = foo.tag({}) | ||||
_bar_hook = bar.with_hooks({a_hook}) | _bar_hook = bar.with_hooks({a_hook}) | ||||
foo_tag() | foo_tag() | ||||
assert ( | assert ( | ||||
len(record) == 1 | len(record) == 1 | ||||
) # ensure that one warning is thrown per solid_name / alias instead of per every CallableSolidNode. | ) # ensure that one warning is thrown per solid_name / alias instead of per every CallableNode. | ||||
def test_compose_nothing(): | def test_compose_nothing(): | ||||
@lambda_solid(input_defs=[InputDefinition("start", Nothing)]) | @lambda_solid(input_defs=[InputDefinition("start", Nothing)]) | ||||
def go(): | def go(): | ||||
pass | pass | ||||
@composite_solid(input_defs=[InputDefinition("start", Nothing)]) | @composite_solid(input_defs=[InputDefinition("start", Nothing)]) | ||||
▲ Show 20 Lines • Show All 153 Lines • Show Last 20 Lines |