diff options
author | Andreas Finkler <3929834+DudeNr33@users.noreply.github.com> | 2022-04-16 13:56:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-16 13:56:35 +0200 |
commit | 0bd2e5aa3edd827e21cf6d1d8cc5900567a54a01 (patch) | |
tree | 6355c7878bbff17a4f7e98fa7936717b7c0c2a62 /tests/checkers | |
parent | 89e78b035a5b8ad01412b03e72e72bb999ac8dc2 (diff) | |
download | pylint-git-0bd2e5aa3edd827e21cf6d1d8cc5900567a54a01.tar.gz |
Deprecate ``check_messages`` in favor of ``only_required_for_messages`` (#6196)
* Add TypeVars for ``BaseChecker`` subclasses and AST callbacks
Co-authored-by: Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com>
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
Diffstat (limited to 'tests/checkers')
-rw-r--r-- | tests/checkers/unittest_utils.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/checkers/unittest_utils.py b/tests/checkers/unittest_utils.py index 1ac461141..178d5467b 100644 --- a/tests/checkers/unittest_utils.py +++ b/tests/checkers/unittest_utils.py @@ -473,3 +473,18 @@ def test_deprecation_is_inside_lambda() -> None: with pytest.warns(DeprecationWarning) as records: utils.is_inside_lambda(nodes.NodeNG()) assert len(records) == 1 + + +def test_deprecation_check_messages() -> None: + with pytest.warns(DeprecationWarning) as records: + + class Checker: # pylint: disable=unused-variable + @utils.check_messages("my-message") + def visit_assname(self, node): + pass + + assert len(records) == 1 + assert ( + records[0].message.args[0] + == "utils.check_messages will be removed in favour of calling utils.only_required_for_messages in pylint 3.0" + ) |