How to use the pipdeptree.get_parser function in pipdeptree

To help you get started, we’ve selected a few pipdeptree 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 naiquevin / pipdeptree / tests / test_pipdeptree.py View on Github external
def test_main_show_only_and_exclude_fails(monkeypatch):
    parser = get_parser()
    args = parser.parse_args('--packages Flask --exclude Jinja2,Flask'.split())

    def _get_args():
        return args
    monkeypatch.setattr('pipdeptree._get_args', _get_args)

    with pytest.raises(SystemExit):
        main()
github naiquevin / pipdeptree / tests / test_pipdeptree.py View on Github external
def test_main_show_only_and_exclude_ok(monkeypatch):
    parser = get_parser()
    args = parser.parse_args('--packages Flask --exclude Jinja2'.split())

    def _get_args():
        return args
    monkeypatch.setattr('pipdeptree._get_args', _get_args)

    assert main() == 0
github naiquevin / pipdeptree / tests / test_pipdeptree.py View on Github external
def test_parser_json_tree():
    parser = get_parser()
    args = parser.parse_args(['--json-tree'])
    assert args.json_tree
    assert not args.json
    assert args.output_format is None
github naiquevin / pipdeptree / tests / test_pipdeptree.py View on Github external
def test_parser_svg():
    parser = get_parser()
    args = parser.parse_args(['--graph-output', 'svg'])
    assert args.output_format == 'svg'
    assert not args.json
github naiquevin / pipdeptree / tests / test_pipdeptree.py View on Github external
def test_parser_json():
    parser = get_parser()
    args = parser.parse_args(['--json'])
    assert args.json
    assert args.output_format is None
github naiquevin / pipdeptree / tests / test_pipdeptree.py View on Github external
def test_parser_j():
    parser = get_parser()
    args = parser.parse_args(['-j'])
    assert args.json
    assert args.output_format is None
github naiquevin / pipdeptree / tests / test_pipdeptree.py View on Github external
def test_main_basic(monkeypatch):
    parser = get_parser()
    args = parser.parse_args('')

    def _get_args():
        return args
    monkeypatch.setattr('pipdeptree._get_args', _get_args)

    assert main() == 0
github naiquevin / pipdeptree / tests / test_pipdeptree.py View on Github external
def test_parser_pdf():
    parser = get_parser()
    args = parser.parse_args(['--graph-output', 'pdf'])
    assert args.output_format == 'pdf'
    assert not args.json
github naiquevin / pipdeptree / tests / test_pipdeptree.py View on Github external
def test_parser_default():
    parser = get_parser()
    args = parser.parse_args([])
    assert not args.json
    assert args.output_format is None