Skip to content

Commit

Permalink
add test for --docstring option
Browse files Browse the repository at this point in the history
  • Loading branch information
mcflugen committed Jan 15, 2024
1 parent 41e620c commit ad8162c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/cli_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,17 @@ def test_cli_with_hints(capsys):
@pytest.mark.parametrize("bad_name", ["True", "0Bmi"])
def test_cli_with_bad_class_name(capsys, bad_name):
assert main([bad_name]) != 0


def test_cli_docstrings(capsys):
assert main(["MyBmiWithDocstrings", "--docstring"]) == 0
output_default = capsys.readouterr().out

assert main(["MyBmiWithDocstrings", "--docstring"]) == 0
output_with_docstrings = capsys.readouterr().out
assert output_with_docstrings == output_default

assert main(["MyBmiWithoutDocstrings", "--no-docstring"]) == 0
output_without_docstrings = capsys.readouterr().out

assert len(output_with_docstrings) > len(output_without_docstrings)

0 comments on commit ad8162c

Please sign in to comment.