Beispiel #1
0
def test_custom_parser_error_if_unable_to_automatically_locate_entry_point(
        capsys):
    parser = CustomParser()

    with parser:
        pass

    with pytest.raises(SystemExit) as excinfo:
        parser.parse_entry_point_value()

    captured = capsys.readouterr()

    assert excinfo.value.code == 2
    assert 'Unable to find a pipeline entry point' in captured.err
Beispiel #2
0
def test_error_if_missing_entry_point_value(monkeypatch, capsys):
    monkeypatch.setattr(sys, 'argv', ['ploomber', '--entry-point'])

    parser = CustomParser()

    with parser:
        pass

    with pytest.raises(SystemExit) as excinfo:
        parser.parse_entry_point_value()

    captured = capsys.readouterr()

    assert excinfo.value.code == 2
    assert ('ploomber: error: argument --entry-point/-e: expected one argument'
            in captured.err)