How to use the julia.pseudo_python_cli.parse_args function in julia

To help you get started, we’ve selected a few julia examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github JuliaPy / pyjulia / test / test_pseudo_python_cli.py View on Github external
def test_help_option(args, capsys):
    with pytest.raises(SystemExit) as exc_info:
        parse_args(shlex.split(args))
    assert exc_info.value.code == 0

    captured = capsys.readouterr()
    assert "usage:" in captured.out
    assert not captured.err
github JuliaPy / pyjulia / test / test_pseudo_python_cli.py View on Github external
def test_valid_args(args, desired):
    ns = parse_args(shlex.split(args))
    actual = vars(ns)
    assert actual == desired
github JuliaPy / pyjulia / test / test_pseudo_python_cli.py View on Github external
def test_invalid_args(args, capsys):
    with pytest.raises(SystemExit) as exc_info:
        parse_args(shlex.split(args))
    assert exc_info.value.code != 0

    captured = capsys.readouterr()
    assert "usage:" in captured.err
    assert not captured.out
github JuliaPy / pyjulia / test / test_pseudo_python_cli.py View on Github external
def test_version_option(args, capsys):
    with pytest.raises(SystemExit) as exc_info:
        parse_args(shlex.split(args))
    assert exc_info.value.code == 0

    captured = capsys.readouterr()
    assert "Python " in captured.out
    assert not captured.err
github JuliaPy / pyjulia / test / test_pseudo_python_cli.py View on Github external
def make_dict(**kwargs):
    ns = parse_args([])
    return dict(vars(ns), **kwargs)