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/extensions/test_docstyle.py | |
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/extensions/test_docstyle.py')
-rw-r--r-- | tests/extensions/test_docstyle.py | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/tests/extensions/test_docstyle.py b/tests/extensions/test_docstyle.py deleted file mode 100644 index 7c1d019e7..000000000 --- a/tests/extensions/test_docstyle.py +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright (c) 2016-2018, 2020 Claudiu Popa <pcmanticore@gmail.com> -# Copyright (c) 2016-2017 Derek Gustafson <degustaf@gmail.com> -# Copyright (c) 2016 Luis Escobar <lescobar@vauxoo.com> -# Copyright (c) 2019-2021 Pierre Sassoulas <pierre.sassoulas@gmail.com> -# Copyright (c) 2019 Ashley Whetter <ashley@awhetter.co.uk> -# Copyright (c) 2020 hippo91 <guillaume.peillex@gmail.com> -# Copyright (c) 2021 Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - -# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html -# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE - -"""Tests for the pylint checker in :mod:`pylint.extensions.check_docstring -""" - -from os.path import abspath, dirname, join - -import pytest - -from pylint.extensions.docstyle import DocStringStyleChecker -from pylint.lint.pylinter import PyLinter - -EXPECTED_MSGS = [ - "First line empty in function docstring", - "First line empty in class docstring", - "First line empty in method docstring", - "Bad docstring quotes in method, expected \"\"\", given '''", - 'Bad docstring quotes in method, expected """, given "', - 'Bad docstring quotes in method, expected """, given \'', - 'Bad docstring quotes in method, expected """, given \'', -] - -EXPECTED_SYMBOLS = [ - "docstring-first-line-empty", - "docstring-first-line-empty", - "docstring-first-line-empty", - "bad-docstring-quotes", - "bad-docstring-quotes", - "bad-docstring-quotes", - "bad-docstring-quotes", -] - - -@pytest.fixture(scope="module") -def checker(): - return DocStringStyleChecker - - -def test_docstring_message(linter: PyLinter) -> None: - docstring_test = join(dirname(abspath(__file__)), "data", "docstring.py") - linter.check([docstring_test]) - msgs = linter.reporter.messages - assert len(msgs) == 7 - for msg, expected_symbol, expected_msg in zip( - msgs, EXPECTED_SYMBOLS, EXPECTED_MSGS - ): - assert msg.symbol == expected_symbol - assert msg.msg == expected_msg |