How to use the pipdeptree.main 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_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