Display list of available formatters with help for --format

This commit is contained in:
Albert Tugushev 2022-07-28 22:06:58 +02:00 committed by Anthony Sottile
parent fbb33430e6
commit 48b2919130
8 changed files with 35 additions and 4 deletions

View file

@ -406,3 +406,13 @@ The specified config file does not exist: missing.cfg
out, err = capsys.readouterr()
assert out == expected
assert err == ""
def test_format_option_help(capsys):
"""Test that help displays list of available formatters."""
with pytest.raises(SystemExit):
cli.main(["--help"])
out, err = capsys.readouterr()
assert "(default, pylint, quiet-filename, quiet-nothing)" in out
assert err == ""