diff options
author | Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com> | 2021-11-30 00:22:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-30 00:22:15 +0100 |
commit | c278e058c51ea633c0a2761a48410b392cf10e82 (patch) | |
tree | 5bb8664bccef6868c5aafd61be038f6008612e11 /tests/functional/ext/docparams/return/missing_return_doc_required_Sphinx.py | |
parent | 6fa8218aa61335edf3da4fc1d81b07cd76221dc5 (diff) | |
download | pylint-git-c278e058c51ea633c0a2761a48410b392cf10e82.tar.gz |
Move ``TestDocstringCheckerReturn`` to functional tests (#5438)
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
Diffstat (limited to 'tests/functional/ext/docparams/return/missing_return_doc_required_Sphinx.py')
-rw-r--r-- | tests/functional/ext/docparams/return/missing_return_doc_required_Sphinx.py | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/functional/ext/docparams/return/missing_return_doc_required_Sphinx.py b/tests/functional/ext/docparams/return/missing_return_doc_required_Sphinx.py new file mode 100644 index 000000000..61be7696e --- /dev/null +++ b/tests/functional/ext/docparams/return/missing_return_doc_required_Sphinx.py @@ -0,0 +1,45 @@ +"""Tests for missing-return-doc and missing-return-type-doc for Sphinx style docstrings +with accept-no-returns-doc = no""" +# pylint: disable=function-redefined, invalid-name, undefined-variable, missing-function-docstring +# pylint: disable=unused-argument + + +def my_func(self): # [missing-return-type-doc] + """Warn partial sphinx returns + + :returns: Always False + """ + return False + + +def my_func(self) -> bool: + """Sphinx missing return type with annotations + + :returns: Always False + """ + return False + + +def my_func(self): # [missing-return-doc] + """Warn partial sphinx returns type + + :rtype: bool + """ + return False + + +def warn_missing_sphinx_returns(self, doc_type): # [missing-return-type-doc, missing-return-doc] + """This is a docstring. + + :param doc_type: Sphinx + :type doc_type: str + """ + return False + + +def my_func(self): # [missing-return-doc] + """warns_sphinx_return_list_of_custom_class_without_description + + :rtype: list(:class:`mymodule.Class`) + """ + return [mymodule.Class()] |