Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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()
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
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