def test_dag_on_render_with_params(tmp_directory, tmp_imports, write_dag_hooks_spec): dag = DAGSpec('pipeline.yaml').to_dag() dag.executor = Serial(build_in_subprocess=False) dag.render() assert Path('hook').read_text() == 'on render'
def test_dag_on_failure_with_params(tmp_directory, tmp_imports, write_dag_hooks_spec): Path('my_module.py').write_text(""" def touch(product): raise Exception """) dag = DAGSpec('pipeline.yaml').to_dag() dag.executor = Serial(build_in_subprocess=False) with pytest.raises(DAGBuildError): dag.build() assert Path('hook').read_text() == 'on failure'