diff options
author | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2022-02-26 12:35:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-26 12:35:25 +0100 |
commit | 5bdd5034c556d2d4986a365a666e923bccef2a94 (patch) | |
tree | 01eb3f87e1bfc61b47fdb29493955f80a5dc66b9 /tests/message | |
parent | 15040ee7c42958606ae27aa32ccbe54371b83049 (diff) | |
download | pylint-git-5bdd5034c556d2d4986a365a666e923bccef2a94.tar.gz |
Add a test to check that no old msgid or symbol are used (#5839)
* Add deleted msgid and symbol from the Python 3K+ checker and other deleted checks.
See https://github.com/PyCQA/pylint/pull/4942
Closes #5729
Co-authored-by: Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com>
Diffstat (limited to 'tests/message')
-rw-r--r-- | tests/message/test_no_removed_msgid_or_symbol_used.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/message/test_no_removed_msgid_or_symbol_used.py b/tests/message/test_no_removed_msgid_or_symbol_used.py new file mode 100644 index 000000000..c6ece3679 --- /dev/null +++ b/tests/message/test_no_removed_msgid_or_symbol_used.py @@ -0,0 +1,17 @@ +# 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 + +from pylint.constants import DELETED_MESSAGES +from pylint.lint import PyLinter + + +def test_no_removed_msgid_or_symbol_used(linter: PyLinter) -> None: + """Tests that we're not using deleted msgid or symbol. + + This could cause occasional bugs, but more importantly confusion and inconsistencies + when searching for old msgids online. See https://github.com/PyCQA/pylint/issues/5729 + """ + for msgid, symbol, old_names in DELETED_MESSAGES: + linter.msgs_store.message_id_store.register_message_definition( + msgid, symbol, old_names + ) |