diff options
author | Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> | 2021-09-29 10:21:52 +0200 |
---|---|---|
committer | Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> | 2021-09-29 14:17:31 +0200 |
commit | 7c06fe8641293745417e3524577e668cc80710f5 (patch) | |
tree | 3af8f0225902397e9130bce911a46de916e8acfa /tests/extensions | |
parent | 20304a6cfb0dedec8ca7878822b8db1fd3cc71cc (diff) | |
download | pylint-git-7c06fe8641293745417e3524577e668cc80710f5.tar.gz |
Make test decorator use ``checker.set_option()``
This makes unittests with options mimick the normal option setting
behaviour. It also adds ``set_config_directly()`` for those cases where
this is not possible.
Diffstat (limited to 'tests/extensions')
-rw-r--r-- | tests/extensions/test_check_docs.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/extensions/test_check_docs.py b/tests/extensions/test_check_docs.py index 6676c13b4..65d077aed 100644 --- a/tests/extensions/test_check_docs.py +++ b/tests/extensions/test_check_docs.py @@ -31,6 +31,7 @@ from astroid import nodes from pylint.extensions.docparams import DocstringParameterChecker from pylint.testutils import CheckerTestCase, MessageTest, set_config +from pylint.testutils.decorator import set_config_directly class TestParamDocChecker(CheckerTestCase): @@ -2324,7 +2325,7 @@ class TestParamDocChecker(CheckerTestCase): ): self.checker.visit_functiondef(node) - @set_config(no_docstring_rgx=r"^_(?!_).*$") + @set_config_directly(no_docstring_rgx=r"^_(?!_).*$") def test_skip_no_docstring_rgx(self) -> None: """Example of a function that matches the default 'no-docstring-rgx' config option @@ -2342,7 +2343,7 @@ class TestParamDocChecker(CheckerTestCase): with self.assertNoMessages(): self.checker.visit_functiondef(node) - @set_config(docstring_min_length=3) + @set_config_directly(docstring_min_length=3) def test_skip_docstring_min_length(self) -> None: """Example of a function that is less than 'docstring-min-length' config option |