Test autodoc_typehint_undoc

Add new tests to exercise the new autodoc_typehint_undoc option. Where
an existing test would have a meaningful behavior change with the new
option set to False, that test is copied, the new option is set to False
in the copy, and the assertions reflect the new expected behavior.

The new test test_autodoc_typehints_description_with_documented_init
illustrates the problem reported in #7329, and the new test
test_autodoc_typehints_description_with_documented_init_no_undoc
illustrates that this issue no longer occurs when the new
autodoc_typehint_undoc option is set to False.
This commit is contained in:
Matt Wozniski
2020-12-14 19:16:07 -05:00
committed by Matt Wozniski
parent be2cee53a1
commit 4c72848b85
2 changed files with 94 additions and 0 deletions

View File

@@ -68,3 +68,13 @@ def missing_attr(c,
):
# type: (...) -> str
return a + (b or "")
class _ClassWithDocumentedInit:
"""Class docstring."""
def __init__(self, x: int) -> None:
"""Init docstring.
:param x: Some integer
"""