Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pip_audit/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ def _parser() -> argparse.ArgumentParser: # pragma: no cover
metavar="ID",
action="append",
dest="ignore_vulns",
default=[],
default=os.environ.get("PIP_AUDIT_IGNORE_VULNS", "").split(),
help=(
"ignore a specific vulnerability by its vulnerability ID; "
"this option can be used multiple times"
Expand Down
2 changes: 2 additions & 0 deletions test/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ def test_environment_variable(monkeypatch):
monkeypatch.setenv("PIP_AUDIT_OUTPUT", "/tmp/fake")
monkeypatch.setenv("PIP_AUDIT_PROGRESS_SPINNER", "off")
monkeypatch.setenv("PIP_AUDIT_VULNERABILITY_SERVICE", "osv")
monkeypatch.setenv("PIP_AUDIT_IGNORE_VULNS", "cve ghsa xyz")

parser = pip_audit._cli._parser()
monkeypatch.setattr(pip_audit._cli, "_parse_args", lambda *a: parser.parse_args([]))
Expand All @@ -232,3 +233,4 @@ def test_environment_variable(monkeypatch):
assert args.output == Path("/tmp/fake")
assert not args.progress_spinner
assert args.vulnerability_service == VulnerabilityServiceChoice.Osv
assert args.ignore_vulns == ["cve", "ghsa", "xyz"]