Skip to content

Commit

Permalink
log missing docstring messages only if docstrings were actually missi…
Browse files Browse the repository at this point in the history
…ng (#103)
  • Loading branch information
j-ittner authored Oct 14, 2020
1 parent d653487 commit 8f71ea4
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions test/test/test_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,22 +206,22 @@ def test_docstrings(all_script_objects) -> None:
[name for name, obj in inner_methods if docstr_missing(name, obj)]
)

log.info(
f"The following classes lack-docstrings:{str(classes_with_missing_docstr)}"
)
if classes_with_missing_docstr:
log.info(f"The following classes lack-docstrings:{classes_with_missing_docstr}")

log.info(
f"The following functions lack-docstrings:{str(functions_with_missing_docstr)}"
)
if functions_with_missing_docstr:
log.info(
f"The following functions lack-docstrings:{functions_with_missing_docstr}"
)

log.info(
f"The following methods lack-docstrings:{str(methods_with_missing_docstr)}"
)
if methods_with_missing_docstr:
log.info(f"The following methods lack-docstrings:{methods_with_missing_docstr}")

log.info(
f"The following methods have inconsistently described parameters:"
f"{str(inconsistent_parameters)}"
)
if inconsistent_parameters:
log.info(
f"The following methods have inconsistently described parameters:"
f"{inconsistent_parameters}"
)

assert len(classes_with_missing_docstr) == 0
assert len(functions_with_missing_docstr) == 0
Expand Down

0 comments on commit 8f71ea4

Please sign in to comment.