summaryrefslogtreecommitdiff
path: root/tests/conftest.py
diff options
context:
space:
mode:
authorAndreas Finkler <3929834+DudeNr33@users.noreply.github.com>2022-04-16 09:56:56 +0200
committerGitHub <noreply@github.com>2022-04-16 09:56:56 +0200
commitebf7bd6793dc484513455d0c47acd6a285a8d1a5 (patch)
treee2a92f6ce0843b0e9a5130f17aaff91e8be224e0 /tests/conftest.py
parent46bd2decfd92434e42b67340c456332f9c48ae01 (diff)
downloadpylint-git-ebf7bd6793dc484513455d0c47acd6a285a8d1a5.tar.gz
Add ``--minimal-messages-config`` option for functional tests (#6246)
* Add ``--minimal-messages-config`` option for functional tests * Add test file option to exclude from --minimal-messages-config run. * Fix ``too-many-branches`` false negative * Fix ``access-member-before-definition`` false negative * Fix ``consider-using-min-builtin`` and ``consider-using-max-builtin`` false negatives * Fix ``consider-using-with`` false negative * Exclude ``deprecated-module`` tests from ``--minimal-messages-config`` run. Have to find out how the list of deprecated modules is built first. * Update doc/whatsnew/2.14.rst * Ignore deprecated module false negatives * Fix ``deprecated-typing-alias`` false negative * Skip tests for ``fixme`` message, don't know yet how enable/disable affects TokenChecker/RawChecker * Exclude functional test for various logging checks, as the output string depends on what messages are enabled. * Fix false negative for ``nan-comparison`` * Fix false negative for ``non-ascii-module-import`` * Fix false negative for ``non-ascii-file-name`` * Skip tests for logging messages * Fix false negative for ``undefined-variable`` in ``metaclass`` argument * Exclude test for ``catching-non-exception``. ``exc._all_bases_known`` is ``False`` when enabling just this message. * Exclude ``ungrouped_imports_suppression``. ``useless-suppression`` is triggered too often in this case. * Fix false negative for ``use-a-generator`` * Exclude functional tests for ``useless-suppression`` from ``--minimal-messages-config`` * Exclude another deprecation check from ``--minimal-messages-config`` run * Update tests/testutils/data/m/minimal_messages_config.py Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com> Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
Diffstat (limited to 'tests/conftest.py')
-rw-r--r--tests/conftest.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index dd0b1195e..71d37d9c5 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -75,6 +75,17 @@ def pytest_addoption(parser) -> None:
default=False,
help="Run primer external tests",
)
+ parser.addoption(
+ "--minimal-messages-config",
+ action="store_true",
+ default=False,
+ help=(
+ "Disable all messages that are not explicitly expected when running functional tests. "
+ "This is useful for finding problems with the @only_required_for_messages / @check_messages "
+ "decorator, but can also produce false negatives if a functional test file only tests for "
+ "false positive of messages and thus does not declare which messages are expected."
+ ),
+ )
def pytest_collection_modifyitems(config, items) -> None: