Skip to content

Move tests from TestParamDocChecker to functional tests #5509

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Dec 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
301 changes: 0 additions & 301 deletions tests/extensions/test_check_docs.py

This file was deleted.

12 changes: 12 additions & 0 deletions tests/functional/ext/docparams/parameter/missing_param_doc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
"""Tests for missing-param-doc and missing-type-doc for non-specified style docstrings
with accept-no-param-doc = yes
"""
# pylint: disable=invalid-name, unused-argument


def test_tolerate_no_param_documentation_at_all(x, y):
"""Example of a function with no parameter documentation at all

No error message is emitted.

missing parameter documentation"""
7 changes: 7 additions & 0 deletions tests/functional/ext/docparams/parameter/missing_param_doc.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[MASTER]
load-plugins = pylint.extensions.docparams

[BASIC]
accept-no-param-doc=yes
docstring-min-length: -1
no-docstring-rgx=^$
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
"""Tests for missing-param-doc and missing-type-doc for non-specified style docstrings
with accept-no-param-doc = no
"""
# pylint: disable=invalid-name, unused-argument, too-few-public-methods


def test_don_t_tolerate_no_param_documentation_at_all(x, y): # [missing-any-param-doc]
"""Example of a function with no parameter documentation at all

Missing documentation error message is emitted.

missing parameter documentation"""


def test_see_tolerate_no_param_documentation_at_all(x, y):
"""Example for the usage of "For the parameters, see"
to suppress missing-param warnings.

For the parameters, see :func:`blah`
"""


class ClassFoo:
"""Example usage of "For the parameters, see" in init docstring"""

def __init__(self, x, y):
"""docstring foo constructor

For the parameters, see :func:`bla`
"""


class ClassFooTwo:
"""test_see_sentence_for_constr_params_in_class
Example usage of "For the parameters, see" in class docstring

For the parameters, see :func:`bla`
"""

def __init__(self, x, y):
"""init"""


def test_kwonlyargs_are_taken_in_account( # [missing-param-doc, missing-type-doc]
arg, *, kwonly, missing_kwonly
):
"""The docstring

:param int arg: The argument.
:param bool kwonly: A keyword-arg.
"""
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[MASTER]
load-plugins = pylint.extensions.docparams

[BASIC]
accept-no-param-doc=no
docstring-min-length: -1
no-docstring-rgx=^$
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
missing-any-param-doc:7:0:12:38:test_don_t_tolerate_no_param_documentation_at_all:"Missing any documentation in ""test_don_t_tolerate_no_param_documentation_at_all""":UNDEFINED
missing-param-doc:44:0:51:7:test_kwonlyargs_are_taken_in_account:"""missing_kwonly"" missing in parameter documentation":UNDEFINED
missing-type-doc:44:0:51:7:test_kwonlyargs_are_taken_in_account:"""missing_kwonly"" missing in parameter type documentation":UNDEFINED
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"""Tests for missing-param-doc and missing-type-doc for non-specified style docstrings
with accept-no-param-doc = no and docstring-min-length = 3
"""
# pylint: disable=invalid-name, unused-argument

# Example of a function that is less than 'docstring-min-length' config option
# No error message is emitted.
def test_skip_docstring_min_length(x, y):
"""function is too short and is missing parameter documentation"""
Loading