Esempio n. 1
0
def test_dag_on_finish_with_params(tmp_directory, tmp_imports,
                                   write_dag_hooks_spec):

    dag = DAGSpec('pipeline.yaml').to_dag()
    dag.executor = Serial(build_in_subprocess=False)

    dag.build()

    assert Path('hook').read_text() == 'on finish'
Esempio n. 2
0
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'