diff options
author | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-11-22 15:21:27 +0100 |
---|---|---|
committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-11-23 09:50:24 +0100 |
commit | 72d3525b058d264bdef1a7f3276b12e4a64162e6 (patch) | |
tree | 79a3be1d8c224162c3fb832ca36bf4dbeaa6b4ec /tests/functional/d | |
parent | 9e32192fe7bf77281d0dfbc107984b751983e113 (diff) | |
download | pylint-git-72d3525b058d264bdef1a7f3276b12e4a64162e6.tar.gz |
Migrate test for extension to functional tests
This permit to upgrade the fixtures in pre-commit.
Diffstat (limited to 'tests/functional/d')
-rw-r--r-- | tests/functional/d/docstyle_extension.py | 41 | ||||
-rw-r--r-- | tests/functional/d/docstyle_extension.rc | 2 | ||||
-rw-r--r-- | tests/functional/d/docstyle_extension.txt | 7 |
3 files changed, 50 insertions, 0 deletions
diff --git a/tests/functional/d/docstyle_extension.py b/tests/functional/d/docstyle_extension.py new file mode 100644 index 000000000..a5b6161b0 --- /dev/null +++ b/tests/functional/d/docstyle_extension.py @@ -0,0 +1,41 @@ +"""Checks of Dosctrings 'docstring-first-line-empty' 'bad-docstring-quotes'""" + + +def check_messages(*messages): # [docstring-first-line-empty] + """ + docstring""" + return messages + + +def function2(): + """Test Ok""" + + +class FFFF: # [docstring-first-line-empty] + """ + Test Docstring First Line Empty + """ + + def method1(self): # [docstring-first-line-empty, bad-docstring-quotes] + ''' + Test Triple Single Quotes docstring + ''' + + def method2(self): # [bad-docstring-quotes] + "bad docstring 1" + + def method3(self): # [bad-docstring-quotes] + 'bad docstring 2' + + def method4(self): # [bad-docstring-quotes] + ' """bad docstring 3 ' + + @check_messages("bad-open-mode", "redundant-unittest-assert", "deprecated-module") + def method5(self): + """Test OK 1 with decorators""" + + def method6(self): + r"""Test OK 2 with raw string""" + + def method7(self): + u"""Test OK 3 with unicode string""" diff --git a/tests/functional/d/docstyle_extension.rc b/tests/functional/d/docstyle_extension.rc new file mode 100644 index 000000000..5128289ff --- /dev/null +++ b/tests/functional/d/docstyle_extension.rc @@ -0,0 +1,2 @@ +[MASTER] +load-plugins=pylint.extensions.docstyle, diff --git a/tests/functional/d/docstyle_extension.txt b/tests/functional/d/docstyle_extension.txt new file mode 100644 index 000000000..8a30eedee --- /dev/null +++ b/tests/functional/d/docstyle_extension.txt @@ -0,0 +1,7 @@ +docstring-first-line-empty:4:0:check_messages:First line empty in function docstring:HIGH +docstring-first-line-empty:14:0:FFFF:First line empty in class docstring:HIGH +bad-docstring-quotes:19:4:FFFF.method1:"Bad docstring quotes in method, expected """""", given '''":HIGH +docstring-first-line-empty:19:4:FFFF.method1:First line empty in method docstring:HIGH +bad-docstring-quotes:24:4:FFFF.method2:"Bad docstring quotes in method, expected """""", given """:HIGH +bad-docstring-quotes:27:4:FFFF.method3:"Bad docstring quotes in method, expected """""", given '":HIGH +bad-docstring-quotes:30:4:FFFF.method4:"Bad docstring quotes in method, expected """""", given '":HIGH |