From 4655b92a6c1fcba1eafed35bd920afbe19c76855 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 12 Dec 2022 14:32:33 +0100 Subject: [PATCH 1/9] Prevent `used-before-assignment` in pattern matching with a guard (#7922) (#7923) (cherry picked from commit bc9f15fda2e85facb230b3372cddb9ae40b4f3d5) Co-authored-by: Jacob Walls --- doc/whatsnew/fragments/5327.false_positive | 4 ++++ pylint/checkers/variables.py | 3 +++ tests/functional/u/used/used_before_assignment_py310.py | 7 +++++++ tests/functional/u/used/used_before_assignment_py310.rc | 2 ++ 4 files changed, 16 insertions(+) create mode 100644 doc/whatsnew/fragments/5327.false_positive create mode 100644 tests/functional/u/used/used_before_assignment_py310.py create mode 100644 tests/functional/u/used/used_before_assignment_py310.rc diff --git a/doc/whatsnew/fragments/5327.false_positive b/doc/whatsnew/fragments/5327.false_positive new file mode 100644 index 0000000000..0cac649f80 --- /dev/null +++ b/doc/whatsnew/fragments/5327.false_positive @@ -0,0 +1,4 @@ +Fix false-positive for ``used-before-assignment`` in pattern matching +with a guard. + +Closes #5327 diff --git a/pylint/checkers/variables.py b/pylint/checkers/variables.py index f1c81fc33d..8e9a3c9bb5 100644 --- a/pylint/checkers/variables.py +++ b/pylint/checkers/variables.py @@ -1945,6 +1945,7 @@ def _is_variable_violation( nodes.AugAssign, nodes.Expr, nodes.Return, + nodes.Match, ), ) and VariablesChecker._maybe_used_and_assigned_at_once(defstmt) @@ -2045,6 +2046,8 @@ def _maybe_used_and_assigned_at_once(defstmt: nodes.Statement) -> bool: """Check if `defstmt` has the potential to use and assign a name in the same statement. """ + if isinstance(defstmt, nodes.Match): + return any(case.guard for case in defstmt.cases) if isinstance(defstmt.value, nodes.BaseContainer) and defstmt.value.elts: # The assignment must happen as part of the first element # e.g. "assert (x:= True), x" diff --git a/tests/functional/u/used/used_before_assignment_py310.py b/tests/functional/u/used/used_before_assignment_py310.py new file mode 100644 index 0000000000..14f46b61e9 --- /dev/null +++ b/tests/functional/u/used/used_before_assignment_py310.py @@ -0,0 +1,7 @@ +"""Tests for used-before-assignment with python 3.10's pattern matching""" + +match ("example", "one"): + case (x, y) if x == "example": + print("x used to cause used-before-assignment!") + case _: + print("good thing it doesn't now!") diff --git a/tests/functional/u/used/used_before_assignment_py310.rc b/tests/functional/u/used/used_before_assignment_py310.rc new file mode 100644 index 0000000000..68a8c8ef15 --- /dev/null +++ b/tests/functional/u/used/used_before_assignment_py310.rc @@ -0,0 +1,2 @@ +[testoptions] +min_pyver=3.10 From 391323e587a38e1e3042390e4a2f552efbfe0781 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 13 Dec 2022 08:37:04 +0100 Subject: [PATCH 2/9] Avoid hanging forever after a parallel job was killed (#7834) (#7930) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Replace multiprocessing.pool with concurrent.futures.ProcessPoolExecutor to avoid deadlocks. In a multiprocessing.pool, if a process terminates in a non-clean fashion (for example, due to OOM or a segmentation fault), the pool will silently replace said process, but the work that the process was supposed to do will never be done, causing pylint to hang indefinitely. The concurrent.futures.ProcessPoolExecutor will raise a BrokenProcessPool exception in that case, avoiding the hang. Co-authored-by: Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com> (cherry picked from commit 5eca8ec5947a0d45e588bded0e910a986d4dd77b) Co-authored-by: Daniel --- doc/whatsnew/fragments/3899.bugfix | 4 ++++ pylint/lint/parallel.py | 21 +++++++++--------- pylint/lint/run.py | 9 ++++++-- tests/test_check_parallel.py | 35 +++++++++++++++++++++++++----- 4 files changed, 52 insertions(+), 17 deletions(-) create mode 100644 doc/whatsnew/fragments/3899.bugfix diff --git a/doc/whatsnew/fragments/3899.bugfix b/doc/whatsnew/fragments/3899.bugfix new file mode 100644 index 0000000000..ed0ad38594 --- /dev/null +++ b/doc/whatsnew/fragments/3899.bugfix @@ -0,0 +1,4 @@ +Pylint will no longer deadlock if a parallel job is killed but fail +immediately instead. + +Closes #3899 diff --git a/pylint/lint/parallel.py b/pylint/lint/parallel.py index 646d269943..8de083655d 100644 --- a/pylint/lint/parallel.py +++ b/pylint/lint/parallel.py @@ -23,10 +23,15 @@ except ImportError: multiprocessing = None # type: ignore[assignment] +try: + from concurrent.futures import ProcessPoolExecutor +except ImportError: + ProcessPoolExecutor = None # type: ignore[assignment,misc] + if TYPE_CHECKING: from pylint.lint import PyLinter -# PyLinter object used by worker processes when checking files using multiprocessing +# PyLinter object used by worker processes when checking files using parallel mode # should only be used by the worker processes _worker_linter: PyLinter | None = None @@ -34,8 +39,7 @@ def _worker_initialize( linter: bytes, arguments: None | str | Sequence[str] = None ) -> None: - """Function called to initialize a worker for a Process within a multiprocessing - Pool. + """Function called to initialize a worker for a Process within a concurrent Pool. :param linter: A linter-class (PyLinter) instance pickled with dill :param arguments: File or module name(s) to lint and to be added to sys.path @@ -137,9 +141,9 @@ def check_parallel( # is identical to the linter object here. This is required so that # a custom PyLinter object can be used. initializer = functools.partial(_worker_initialize, arguments=arguments) - with multiprocessing.Pool( - jobs, initializer=initializer, initargs=[dill.dumps(linter)] - ) as pool: + with ProcessPoolExecutor( + max_workers=jobs, initializer=initializer, initargs=(dill.dumps(linter),) + ) as executor: linter.open() all_stats = [] all_mapreduce_data: defaultdict[ @@ -158,7 +162,7 @@ def check_parallel( stats, msg_status, mapreduce_data, - ) in pool.imap_unordered(_worker_check_single_file, files): + ) in executor.map(_worker_check_single_file, files): linter.file_state.base_name = base_name linter.file_state._is_base_filestate = False linter.set_current_module(module, file_path) @@ -168,8 +172,5 @@ def check_parallel( all_mapreduce_data[worker_idx].append(mapreduce_data) linter.msg_status |= msg_status - pool.close() - pool.join() - _merge_mapreduce_data(linter, all_mapreduce_data) linter.stats = merge_stats([linter.stats] + all_stats) diff --git a/pylint/lint/run.py b/pylint/lint/run.py index b8923aac5f..6a6d3a05da 100644 --- a/pylint/lint/run.py +++ b/pylint/lint/run.py @@ -30,6 +30,11 @@ except ImportError: multiprocessing = None # type: ignore[assignment] +try: + from concurrent.futures import ProcessPoolExecutor +except ImportError: + ProcessPoolExecutor = None # type: ignore[assignment,misc] + def _query_cpu() -> int | None: """Try to determine number of CPUs allotted in a docker container. @@ -185,9 +190,9 @@ def __init__( ) sys.exit(32) if linter.config.jobs > 1 or linter.config.jobs == 0: - if multiprocessing is None: + if ProcessPoolExecutor is None: print( - "Multiprocessing library is missing, fallback to single process", + "concurrent.futures module is missing, fallback to single process", file=sys.stderr, ) linter.set_option("jobs", 1) diff --git a/tests/test_check_parallel.py b/tests/test_check_parallel.py index a7fb5c158f..3856f9add0 100644 --- a/tests/test_check_parallel.py +++ b/tests/test_check_parallel.py @@ -9,8 +9,9 @@ from __future__ import annotations import argparse -import multiprocessing import os +from concurrent.futures import ProcessPoolExecutor +from concurrent.futures.process import BrokenProcessPool from pickle import PickleError import dill @@ -182,10 +183,10 @@ def test_worker_initialize_pickling(self) -> None: """ linter = PyLinter(reporter=Reporter()) linter.attribute = argparse.ArgumentParser() # type: ignore[attr-defined] - with multiprocessing.Pool( - 2, initializer=worker_initialize, initargs=[dill.dumps(linter)] - ) as pool: - pool.imap_unordered(print, [1, 2]) + with ProcessPoolExecutor( + max_workers=2, initializer=worker_initialize, initargs=(dill.dumps(linter),) + ) as executor: + executor.map(print, [1, 2]) def test_worker_check_single_file_uninitialised(self) -> None: pylint.lint.parallel._worker_linter = None @@ -571,3 +572,27 @@ def test_map_reduce(self, num_files, num_jobs, num_checkers): assert str(stats_single_proc.by_msg) == str( stats_check_parallel.by_msg ), "Single-proc and check_parallel() should return the same thing" + + @pytest.mark.timeout(5) + def test_no_deadlock_due_to_initializer_error(self) -> None: + """Tests that an error in the initializer for the parallel jobs doesn't + lead to a deadlock. + """ + linter = PyLinter(reporter=Reporter()) + + linter.register_checker(SequentialTestChecker(linter)) + + # Create a dummy file, the actual contents of which will be ignored by the + # register test checkers, but it will trigger at least a single-job to be run. + single_file_container = _gen_file_datas(count=1) + + # The error in the initializer should trigger a BrokenProcessPool exception + with pytest.raises(BrokenProcessPool): + check_parallel( + linter, + jobs=1, + files=iter(single_file_container), + # This will trigger an exception in the initializer for the parallel jobs + # because arguments has to be an Iterable. + arguments=1, # type: ignore[arg-type] + ) From eadc308583e98ec1a38e58830e5425f8aba9e7db Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Thu, 8 Dec 2022 12:01:35 +0100 Subject: [PATCH 3/9] [github actions] Fix enchant's install in the spelling job --- .github/workflows/checks.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index d49a4711ac..30dd1b1e3b 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -121,7 +121,7 @@ jobs: - name: Install enchant and aspell run: | sudo apt-get update - sudo apt-get install enchant aspell-en + sudo apt-get install enchant-2 aspell-en - name: Run pylint checks run: | . venv/bin/activate From 83668de8080a8adf2393dcda826100c6dba8267c Mon Sep 17 00:00:00 2001 From: Sandro Tosi Date: Wed, 14 Dec 2022 13:43:59 -0500 Subject: [PATCH 4/9] fix: bump dill to >= 0.3.6, prevents tests hanging with python3.11 (#7918) Co-authored-by: Pierre Sassoulas --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 90153e9de0..29551fda0d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,8 @@ classifiers = [ ] requires-python = ">=3.7.2" dependencies = [ - "dill>=0.2", + "dill>=0.2;python_version<'3.11'", + "dill>=0.3.6;python_version>='3.11'", "platformdirs>=2.2.0", # Also upgrade requirements_test_min.txt. # Pinned to dev of second minor update to allow editable installs and fix primer issues, From 494e5145ddf6ffb2d2f16f53b8ad6a2c08e08150 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 14 Dec 2022 20:33:31 +0100 Subject: [PATCH 5/9] Fix ModuleNotFoundError when using pylint_django (#7940) (#7941) Ensure that the import path is fixed up before calling ._astroid_module_checker() so that the pylint_django plugin can successfully import the Django settings module when its checkers are initialized. Closes #7938 (cherry picked from commit 491eef5b97c4cab5c96f54bc1a8c9cfa1e7b0a51) Co-authored-by: Daniel Harding --- doc/whatsnew/fragments/7938.bugfix | 3 +++ pylint/lint/pylinter.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 doc/whatsnew/fragments/7938.bugfix diff --git a/doc/whatsnew/fragments/7938.bugfix b/doc/whatsnew/fragments/7938.bugfix new file mode 100644 index 0000000000..1cffb9d1f4 --- /dev/null +++ b/doc/whatsnew/fragments/7938.bugfix @@ -0,0 +1,3 @@ +Fixes a ``ModuleNotFound`` exception when running pylint on a Django project with the ``pylint_django`` plugin enabled. + +Closes #7938 diff --git a/pylint/lint/pylinter.py b/pylint/lint/pylinter.py index 5a600eb5ba..e8923ad27f 100644 --- a/pylint/lint/pylinter.py +++ b/pylint/lint/pylinter.py @@ -690,8 +690,8 @@ def check(self, files_or_modules: Sequence[str] | str) -> None: data = None # The contextmanager also opens all checkers and sets up the PyLinter class - with self._astroid_module_checker() as check_astroid_module: - with fix_import_path(files_or_modules): + with fix_import_path(files_or_modules): + with self._astroid_module_checker() as check_astroid_module: # 4) Get the AST for each FileItem ast_per_fileitem = self._get_asts(fileitems, data) From dca394035268a234b29d0c103a4fcc201c84061f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 15 Dec 2022 09:20:18 +0100 Subject: [PATCH 6/9] Fix inconsistent argument exit code when argparse exit with its own error code (#7931) (#7943) Returning 2 here is confusing as it doesn't match the documentation: https://pylint.pycqa.org/en/latest/user_guide/usage/run.html#exit-codes * pylint: use exit code 32 when invalid arguments are passed * pylint: add failing test when ambiguous abbreviated parameters are set in a config file This is confusing behaviour. The output is: ``` usage: pylint [options] pylint: error: ambiguous option: --no could match --notes, --notes-rgx, --no-docstring-rgx ``` The exit code is 2 which doesn't match the documentation: https://pylint.pycqa.org/en/latest/user_guide/usage/run.html#exit-codes * pylint: use exit code 32 when ambiguous abbreviated parameters are set in a config file Co-authored-by: Pierre Sassoulas (cherry picked from commit 62232b33a525a2b8ef8638a59a03e459ca069c4c) Co-authored-by: David Lawson --- doc/whatsnew/fragments/7931.bugfix | 3 +++ pylint/config/arguments_manager.py | 9 ++++--- pylint/config/config_initialization.py | 5 +++- tests/lint/test_run_pylint.py | 36 ++++++++++++++++++++++++++ tests/lint/unittest_expand_modules.py | 9 +++++++ 5 files changed, 58 insertions(+), 4 deletions(-) create mode 100644 doc/whatsnew/fragments/7931.bugfix create mode 100644 tests/lint/test_run_pylint.py diff --git a/doc/whatsnew/fragments/7931.bugfix b/doc/whatsnew/fragments/7931.bugfix new file mode 100644 index 0000000000..fe42346f43 --- /dev/null +++ b/doc/whatsnew/fragments/7931.bugfix @@ -0,0 +1,3 @@ +When pylint exit due to bad arguments being provided the exit code will now be the expected ``32``. + +Refs #7931 diff --git a/pylint/config/arguments_manager.py b/pylint/config/arguments_manager.py index 40058071cc..6b9a8dce29 100644 --- a/pylint/config/arguments_manager.py +++ b/pylint/config/arguments_manager.py @@ -252,9 +252,12 @@ def _load_default_argument_values(self) -> None: def _parse_configuration_file(self, arguments: list[str]) -> None: """Parse the arguments found in a configuration file into the namespace.""" - self.config, parsed_args = self._arg_parser.parse_known_args( - arguments, self.config - ) + try: + self.config, parsed_args = self._arg_parser.parse_known_args( + arguments, self.config + ) + except SystemExit: + sys.exit(32) unrecognized_options: list[str] = [] for opt in parsed_args: if opt.startswith("--"): diff --git a/pylint/config/config_initialization.py b/pylint/config/config_initialization.py index b903a58026..d26f0e8c58 100644 --- a/pylint/config/config_initialization.py +++ b/pylint/config/config_initialization.py @@ -87,7 +87,10 @@ def _config_initialization( unrecognized_options.append(opt[1:]) if unrecognized_options: msg = ", ".join(unrecognized_options) - linter._arg_parser.error(f"Unrecognized option found: {msg}") + try: + linter._arg_parser.error(f"Unrecognized option found: {msg}") + except SystemExit: + sys.exit(32) # Now that config file and command line options have been loaded # with all disables, it is safe to emit messages diff --git a/tests/lint/test_run_pylint.py b/tests/lint/test_run_pylint.py new file mode 100644 index 0000000000..73dc26331b --- /dev/null +++ b/tests/lint/test_run_pylint.py @@ -0,0 +1,36 @@ +# 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 +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + +from pathlib import Path + +import pytest +from _pytest.capture import CaptureFixture + +from pylint import run_pylint + + +def test_run_pylint_with_invalid_argument(capsys: CaptureFixture[str]) -> None: + """Check that appropriate exit code is used with invalid argument.""" + with pytest.raises(SystemExit) as ex: + run_pylint(["--never-use-this"]) + captured = capsys.readouterr() + assert captured.err.startswith("usage: pylint [options]") + assert ex.value.code == 32 + + +def test_run_pylint_with_invalid_argument_in_config( + capsys: CaptureFixture[str], tmp_path: Path +) -> None: + """Check that appropriate exit code is used with an ambiguous + argument in a config file. + """ + test_file = tmp_path / "testpylintrc" + with open(test_file, "w", encoding="utf-8") as f: + f.write("[MASTER]\nno=") + + with pytest.raises(SystemExit) as ex: + run_pylint(["--rcfile", f"{test_file}"]) + captured = capsys.readouterr() + assert captured.err.startswith("usage: pylint [options]") + assert ex.value.code == 32 diff --git a/tests/lint/unittest_expand_modules.py b/tests/lint/unittest_expand_modules.py index 3336c47bde..005eef387a 100644 --- a/tests/lint/unittest_expand_modules.py +++ b/tests/lint/unittest_expand_modules.py @@ -69,6 +69,14 @@ def test__is_in_ignore_list_re_match() -> None: "path": str(TEST_DIRECTORY / "lint/test_utils.py"), } +test_run_pylint = { + "basename": "lint", + "basepath": INIT_PATH, + "isarg": False, + "name": "lint.test_run_pylint", + "path": str(TEST_DIRECTORY / "lint/test_run_pylint.py"), +} + test_pylinter = { "basename": "lint", "basepath": INIT_PATH, @@ -102,6 +110,7 @@ def _list_expected_package_modules( init_of_package, test_caching, test_pylinter, + test_run_pylint, test_utils, this_file_from_init_deduplicated if deduplicating else this_file_from_init, unittest_lint, From 3c3ab98b5e36951c60a4e7bacc025b6ac6eb4e26 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Thu, 15 Dec 2022 10:50:34 +0100 Subject: [PATCH 7/9] [pypy3.8] Disable multiple-statements false positive on affected functional tests --- .../a/alternative/alternative_union_syntax.py | 4 +- .../alternative_union_syntax_error.py | 14 ++- .../alternative_union_syntax_error.txt | 52 +++++----- .../alternative_union_syntax_py37.py | 13 ++- .../alternative_union_syntax_py37.txt | 18 ++-- tests/functional/d/dataclass_typecheck.py | 5 + tests/functional/d/dataclass_typecheck.txt | 24 ++--- .../ext/typing/typing_consider_using_alias.py | 6 ++ .../typing/typing_consider_using_alias.txt | 40 ++++---- ...ing_consider_using_alias_without_future.py | 9 +- ...ng_consider_using_alias_without_future.txt | 40 ++++---- .../ext/typing/typing_consider_using_union.py | 6 ++ .../typing/typing_consider_using_union.txt | 20 ++-- ...ing_consider_using_union_without_future.py | 6 ++ ...ng_consider_using_union_without_future.txt | 20 ++-- .../functional/i/invalid/invalid_metaclass.py | 4 + .../i/invalid/invalid_metaclass.txt | 12 +-- .../i/invalid/invalid_sequence_index.py | 6 +- .../i/invalid/invalid_sequence_index.txt | 38 +++---- .../functional/n/no/no_member_dataclasses.py | 9 +- .../functional/n/no/no_member_dataclasses.txt | 4 +- .../n/no/no_member_subclassed_dataclasses.py | 7 ++ .../n/no/no_member_subclassed_dataclasses.rc | 8 -- .../p/postponed_evaluation_pep585.py | 10 +- .../p/postponed_evaluation_pep585.txt | 38 +++---- .../p/postponed_evaluation_pep585_error.py | 10 +- .../p/postponed_evaluation_pep585_error.txt | 98 +++++++++---------- .../functional/r/redundant_unittest_assert.py | 15 ++- .../r/redundant_unittest_assert.txt | 12 +-- .../r/regression/regression_4439.py | 6 +- .../r/regression/regression_4439.txt | 2 +- .../s/subclassed_final_class_py38.py | 8 +- .../s/subclassed_final_class_py38.txt | 2 +- .../t/too/too_few_public_methods_37.py | 5 + .../t/too/too_many_instance_attributes.py | 4 + .../t/too/too_many_instance_attributes.txt | 2 +- .../too/too_many_instance_attributes_py37.py | 13 ++- .../unpacking/unpacking_non_sequence_py37.py | 9 +- 38 files changed, 356 insertions(+), 243 deletions(-) diff --git a/tests/functional/a/alternative/alternative_union_syntax.py b/tests/functional/a/alternative/alternative_union_syntax.py index 4492323a25..33565223aa 100644 --- a/tests/functional/a/alternative/alternative_union_syntax.py +++ b/tests/functional/a/alternative/alternative_union_syntax.py @@ -1,6 +1,8 @@ """Test PEP 604 - Alternative Union syntax""" + # pylint: disable=missing-function-docstring,unused-argument,invalid-name,missing-class-docstring -# pylint: disable=inherit-non-class,too-few-public-methods,unnecessary-direct-lambda-call +# pylint: disable=inherit-non-class,too-few-public-methods,unnecessary-direct-lambda-call,superfluous-parens + import dataclasses import typing from dataclasses import dataclass diff --git a/tests/functional/a/alternative/alternative_union_syntax_error.py b/tests/functional/a/alternative/alternative_union_syntax_error.py index 9d1f42c225..d998b7f004 100644 --- a/tests/functional/a/alternative/alternative_union_syntax_error.py +++ b/tests/functional/a/alternative/alternative_union_syntax_error.py @@ -1,10 +1,18 @@ -"""Test PEP 604 - Alternative Union syntax -without postponed evaluation of annotations. +"""Test PEP 604 - Alternative Union syntax with postponed evaluation of +annotations enabled. For Python 3.7 - 3.9: Everything should fail. Testing only 3.8/3.9 to support TypedDict. """ -# pylint: disable=missing-function-docstring,unused-argument,invalid-name,missing-class-docstring,inherit-non-class,too-few-public-methods,line-too-long,unnecessary-direct-lambda-call,unnecessary-lambda-assignment + +# pylint: disable=missing-function-docstring,unused-argument,invalid-name,missing-class-docstring +# pylint: disable=inherit-non-class,too-few-public-methods,line-too-long,unnecessary-direct-lambda-call +# pylint: disable=unnecessary-lambda-assignment + +# Disabled because of a bug with pypy 3.8 see +# https://github.com/PyCQA/pylint/pull/7918#issuecomment-1352737369 +# pylint: disable=multiple-statements + import dataclasses import typing from dataclasses import dataclass diff --git a/tests/functional/a/alternative/alternative_union_syntax_error.txt b/tests/functional/a/alternative/alternative_union_syntax_error.txt index 25a768fa3e..6f4c19a4e4 100644 --- a/tests/functional/a/alternative/alternative_union_syntax_error.txt +++ b/tests/functional/a/alternative/alternative_union_syntax_error.txt @@ -1,26 +1,26 @@ -unsupported-binary-operation:14:8:14:30::unsupported operand type(s) for |:INFERENCE -unsupported-binary-operation:15:7:15:35::unsupported operand type(s) for |:INFERENCE -unsupported-binary-operation:17:23:17:33::unsupported operand type(s) for |:INFERENCE -unsupported-binary-operation:18:6:18:22::unsupported operand type(s) for |:INFERENCE -unsupported-binary-operation:18:6:18:15::unsupported operand type(s) for |:INFERENCE -unsupported-binary-operation:19:6:19:34::unsupported operand type(s) for |:INFERENCE -unsupported-binary-operation:20:18:20:46::unsupported operand type(s) for |:INFERENCE -unsupported-binary-operation:23:23:23:32::unsupported operand type(s) for |:INFERENCE -unsupported-binary-operation:25:24:25:33::unsupported operand type(s) for |:INFERENCE -unsupported-binary-operation:27:14:27:23::unsupported operand type(s) for |:INFERENCE -unsupported-binary-operation:29:5:29:14::unsupported operand type(s) for |:INFERENCE -unsupported-binary-operation:31:14:31:23:func:unsupported operand type(s) for |:INFERENCE -unsupported-binary-operation:34:15:34:24:func2:unsupported operand type(s) for |:INFERENCE -unsupported-binary-operation:40:9:40:25::unsupported operand type(s) for |:INFERENCE -unsupported-binary-operation:47:36:47:45::unsupported operand type(s) for |:INFERENCE -unsupported-binary-operation:50:12:50:21:CustomNamedTuple2:unsupported operand type(s) for |:INFERENCE -unsupported-binary-operation:53:12:53:21:CustomNamedTuple3:unsupported operand type(s) for |:INFERENCE -unsupported-binary-operation:57:54:57:63::unsupported operand type(s) for |:INFERENCE -unsupported-binary-operation:59:60:59:69::unsupported operand type(s) for |:INFERENCE -unsupported-binary-operation:62:12:62:21:CustomTypedDict3:unsupported operand type(s) for |:INFERENCE -unsupported-binary-operation:65:12:65:21:CustomTypedDict4:unsupported operand type(s) for |:INFERENCE -unsupported-binary-operation:76:12:76:21:CustomDataClass:unsupported operand type(s) for |:INFERENCE -unsupported-binary-operation:80:12:80:21:CustomDataClass2:unsupported operand type(s) for |:INFERENCE -unsupported-binary-operation:84:12:84:21:CustomDataClass3:unsupported operand type(s) for |:INFERENCE -unsupported-binary-operation:89:12:89:21:CustomDataClass4:unsupported operand type(s) for |:INFERENCE -unsupported-binary-operation:111:31:111:61::unsupported operand type(s) for |:INFERENCE +unsupported-binary-operation:22:8:22:30::unsupported operand type(s) for |:INFERENCE +unsupported-binary-operation:23:7:23:35::unsupported operand type(s) for |:INFERENCE +unsupported-binary-operation:25:23:25:33::unsupported operand type(s) for |:INFERENCE +unsupported-binary-operation:26:6:26:22::unsupported operand type(s) for |:INFERENCE +unsupported-binary-operation:26:6:26:15::unsupported operand type(s) for |:INFERENCE +unsupported-binary-operation:27:6:27:34::unsupported operand type(s) for |:INFERENCE +unsupported-binary-operation:28:18:28:46::unsupported operand type(s) for |:INFERENCE +unsupported-binary-operation:31:23:31:32::unsupported operand type(s) for |:INFERENCE +unsupported-binary-operation:33:24:33:33::unsupported operand type(s) for |:INFERENCE +unsupported-binary-operation:35:14:35:23::unsupported operand type(s) for |:INFERENCE +unsupported-binary-operation:37:5:37:14::unsupported operand type(s) for |:INFERENCE +unsupported-binary-operation:39:14:39:23:func:unsupported operand type(s) for |:INFERENCE +unsupported-binary-operation:42:15:42:24:func2:unsupported operand type(s) for |:INFERENCE +unsupported-binary-operation:48:9:48:25::unsupported operand type(s) for |:INFERENCE +unsupported-binary-operation:55:36:55:45::unsupported operand type(s) for |:INFERENCE +unsupported-binary-operation:58:12:58:21:CustomNamedTuple2:unsupported operand type(s) for |:INFERENCE +unsupported-binary-operation:61:12:61:21:CustomNamedTuple3:unsupported operand type(s) for |:INFERENCE +unsupported-binary-operation:65:54:65:63::unsupported operand type(s) for |:INFERENCE +unsupported-binary-operation:67:60:67:69::unsupported operand type(s) for |:INFERENCE +unsupported-binary-operation:70:12:70:21:CustomTypedDict3:unsupported operand type(s) for |:INFERENCE +unsupported-binary-operation:73:12:73:21:CustomTypedDict4:unsupported operand type(s) for |:INFERENCE +unsupported-binary-operation:84:12:84:21:CustomDataClass:unsupported operand type(s) for |:INFERENCE +unsupported-binary-operation:88:12:88:21:CustomDataClass2:unsupported operand type(s) for |:INFERENCE +unsupported-binary-operation:92:12:92:21:CustomDataClass3:unsupported operand type(s) for |:INFERENCE +unsupported-binary-operation:97:12:97:21:CustomDataClass4:unsupported operand type(s) for |:INFERENCE +unsupported-binary-operation:119:31:119:61::unsupported operand type(s) for |:INFERENCE diff --git a/tests/functional/a/alternative/alternative_union_syntax_py37.py b/tests/functional/a/alternative/alternative_union_syntax_py37.py index 3d9e577f14..41eb75ec6f 100644 --- a/tests/functional/a/alternative/alternative_union_syntax_py37.py +++ b/tests/functional/a/alternative/alternative_union_syntax_py37.py @@ -1,10 +1,17 @@ -"""Test PEP 604 - Alternative Union syntax -with postponed evaluation of annotations enabled. +"""Test PEP 604 - Alternative Union syntax with postponed evaluation of +annotations enabled. For Python 3.7 - 3.9: Most things should work. Testing only 3.8/3.9 to support TypedDict. """ -# pylint: disable=missing-function-docstring,unused-argument,invalid-name,missing-class-docstring,inherit-non-class,too-few-public-methods,line-too-long,unnecessary-direct-lambda-call + +# pylint: disable=missing-function-docstring,unused-argument,invalid-name,missing-class-docstring +# pylint: disable=inherit-non-class,too-few-public-methods,line-too-long,unnecessary-direct-lambda-call + +# Disabled because of a bug with pypy 3.8 see +# https://github.com/PyCQA/pylint/pull/7918#issuecomment-1352737369 +# pylint: disable=multiple-statements + from __future__ import annotations import dataclasses import typing diff --git a/tests/functional/a/alternative/alternative_union_syntax_py37.txt b/tests/functional/a/alternative/alternative_union_syntax_py37.txt index d00b450efd..37901192c1 100644 --- a/tests/functional/a/alternative/alternative_union_syntax_py37.txt +++ b/tests/functional/a/alternative/alternative_union_syntax_py37.txt @@ -1,9 +1,9 @@ -unsupported-binary-operation:15:8:15:30::unsupported operand type(s) for |:INFERENCE -unsupported-binary-operation:16:7:16:35::unsupported operand type(s) for |:INFERENCE -unsupported-binary-operation:24:23:24:32::unsupported operand type(s) for |:INFERENCE -unsupported-binary-operation:26:24:26:33::unsupported operand type(s) for |:INFERENCE -unsupported-binary-operation:28:14:28:23::unsupported operand type(s) for |:INFERENCE -unsupported-binary-operation:41:9:41:25::unsupported operand type(s) for |:INFERENCE -unsupported-binary-operation:48:36:48:45::unsupported operand type(s) for |:INFERENCE -unsupported-binary-operation:58:54:58:63::unsupported operand type(s) for |:INFERENCE -unsupported-binary-operation:60:60:60:69::unsupported operand type(s) for |:INFERENCE +unsupported-binary-operation:22:8:22:30::unsupported operand type(s) for |:INFERENCE +unsupported-binary-operation:23:7:23:35::unsupported operand type(s) for |:INFERENCE +unsupported-binary-operation:31:23:31:32::unsupported operand type(s) for |:INFERENCE +unsupported-binary-operation:33:24:33:33::unsupported operand type(s) for |:INFERENCE +unsupported-binary-operation:35:14:35:23::unsupported operand type(s) for |:INFERENCE +unsupported-binary-operation:48:9:48:25::unsupported operand type(s) for |:INFERENCE +unsupported-binary-operation:55:36:55:45::unsupported operand type(s) for |:INFERENCE +unsupported-binary-operation:65:54:65:63::unsupported operand type(s) for |:INFERENCE +unsupported-binary-operation:67:60:67:69::unsupported operand type(s) for |:INFERENCE diff --git a/tests/functional/d/dataclass_typecheck.py b/tests/functional/d/dataclass_typecheck.py index f15bfead43..9609594910 100644 --- a/tests/functional/d/dataclass_typecheck.py +++ b/tests/functional/d/dataclass_typecheck.py @@ -3,6 +3,11 @@ Tests for regressions from https://github.com/PyCQA/astroid/pull/1126 """ # pylint: disable=missing-docstring,too-few-public-methods,pointless-statement,redefined-builtin, fixme + +# Disabled because of a bug with pypy 3.8 see +# https://github.com/PyCQA/pylint/pull/7918#issuecomment-1352737369 +# pylint: disable=multiple-statements + from dataclasses import dataclass from typing import Callable, Dict, List, Optional diff --git a/tests/functional/d/dataclass_typecheck.txt b/tests/functional/d/dataclass_typecheck.txt index fad9a5ef33..7579556141 100644 --- a/tests/functional/d/dataclass_typecheck.txt +++ b/tests/functional/d/dataclass_typecheck.txt @@ -1,12 +1,12 @@ -invalid-sequence-index:32:6:32:20::Sequence index is not an int, slice, or instance with __index__:UNDEFINED -invalid-slice-index:36:10:36:19::Slice index is not an int, None, or instance with __index__:UNDEFINED -not-callable:39:0:39:14::obj.attr1 is not callable:UNDEFINED -invalid-unary-operand-type:44:6:44:16::"bad operand type for unary -: str":UNDEFINED -unsupported-membership-test:51:11:51:20::Value 'obj.attr1' doesn't support membership test:UNDEFINED -unsubscriptable-object:56:6:56:15::Value 'obj.attr1' is unsubscriptable:UNDEFINED -unsupported-assignment-operation:61:0:61:9::'obj.attr1' does not support item assignment:UNDEFINED -unsupported-delete-operation:66:4:66:13::'obj.attr1' does not support item deletion:UNDEFINED -not-context-manager:91:0:92:8::Context manager 'str' doesn't implement __enter__ and __exit__.:UNDEFINED -invalid-metaclass:99:0:99:11:Test2:Invalid metaclass 'Instance of builtins.int' used:UNDEFINED -unhashable-member:105:0:105:2::'obj.attr5' is unhashable and can't be used as a key in a dict:INFERENCE -isinstance-second-argument-not-valid-type:115:6:115:30::Second argument of isinstance is not a type:UNDEFINED +invalid-sequence-index:37:6:37:20::Sequence index is not an int, slice, or instance with __index__:UNDEFINED +invalid-slice-index:41:10:41:19::Slice index is not an int, None, or instance with __index__:UNDEFINED +not-callable:44:0:44:14::obj.attr1 is not callable:UNDEFINED +invalid-unary-operand-type:49:6:49:16::"bad operand type for unary -: str":UNDEFINED +unsupported-membership-test:56:11:56:20::Value 'obj.attr1' doesn't support membership test:UNDEFINED +unsubscriptable-object:61:6:61:15::Value 'obj.attr1' is unsubscriptable:UNDEFINED +unsupported-assignment-operation:66:0:66:9::'obj.attr1' does not support item assignment:UNDEFINED +unsupported-delete-operation:71:4:71:13::'obj.attr1' does not support item deletion:UNDEFINED +not-context-manager:96:0:97:8::Context manager 'str' doesn't implement __enter__ and __exit__.:UNDEFINED +invalid-metaclass:104:0:104:11:Test2:Invalid metaclass 'Instance of builtins.int' used:UNDEFINED +unhashable-member:110:0:110:2::'obj.attr5' is unhashable and can't be used as a key in a dict:INFERENCE +isinstance-second-argument-not-valid-type:120:6:120:30::Second argument of isinstance is not a type:UNDEFINED diff --git a/tests/functional/ext/typing/typing_consider_using_alias.py b/tests/functional/ext/typing/typing_consider_using_alias.py index 9fe636a96f..8fe3b59186 100644 --- a/tests/functional/ext/typing/typing_consider_using_alias.py +++ b/tests/functional/ext/typing/typing_consider_using_alias.py @@ -3,7 +3,13 @@ 'py-version' needs to be set to '3.7' or '3.8' and 'runtime-typing=no'. With 'from __future__ import annotations' present. """ + # pylint: disable=missing-docstring,invalid-name,unused-argument,line-too-long,unnecessary-direct-lambda-call + +# Disabled because of a bug with pypy 3.8 see +# https://github.com/PyCQA/pylint/pull/7918#issuecomment-1352737369 +# pylint: disable=multiple-statements + from __future__ import annotations import collections diff --git a/tests/functional/ext/typing/typing_consider_using_alias.txt b/tests/functional/ext/typing/typing_consider_using_alias.txt index 0845e2c9cd..2cd299d904 100644 --- a/tests/functional/ext/typing/typing_consider_using_alias.txt +++ b/tests/functional/ext/typing/typing_consider_using_alias.txt @@ -1,20 +1,20 @@ -consider-using-alias:16:6:16:17::'typing.Dict' will be deprecated with PY39, consider using 'dict' instead:INFERENCE -consider-using-alias:17:6:17:10::'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE -consider-using-alias:19:6:19:24::'typing.OrderedDict' will be deprecated with PY39, consider using 'collections.OrderedDict' instead:INFERENCE -consider-using-alias:20:6:20:22::'typing.Awaitable' will be deprecated with PY39, consider using 'collections.abc.Awaitable' instead:INFERENCE -consider-using-alias:21:6:21:21::'typing.Iterable' will be deprecated with PY39, consider using 'collections.abc.Iterable' instead:INFERENCE -consider-using-alias:22:6:22:21::'typing.Hashable' will be deprecated with PY39, consider using 'collections.abc.Hashable' instead:INFERENCE -consider-using-alias:23:6:23:27::'typing.ContextManager' will be deprecated with PY39, consider using 'contextlib.AbstractContextManager' instead:INFERENCE -consider-using-alias:24:6:24:20::'typing.Pattern' will be deprecated with PY39, consider using 're.Pattern' instead:INFERENCE -consider-using-alias:25:7:25:22::'typing.Match' will be deprecated with PY39, consider using 're.Match' instead:INFERENCE -consider-using-alias:34:9:34:13::'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE -consider-using-alias:36:7:36:11::'typing.Type' will be deprecated with PY39, consider using 'type' instead:INFERENCE -consider-using-alias:37:7:37:12::'typing.Tuple' will be deprecated with PY39, consider using 'tuple' instead:INFERENCE -consider-using-alias:38:7:38:15::'typing.Callable' will be deprecated with PY39, consider using 'collections.abc.Callable' instead:INFERENCE -consider-using-alias:44:74:44:78:func1:'typing.Dict' will be deprecated with PY39, consider using 'dict' instead:INFERENCE -consider-using-alias:44:16:44:20:func1:'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE -consider-using-alias:44:37:44:41:func1:'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE -consider-using-alias:44:93:44:105:func1:'typing.Tuple' will be deprecated with PY39, consider using 'tuple' instead:INFERENCE -consider-using-alias:60:12:60:16:CustomNamedTuple:'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE -consider-using-alias:65:12:65:16:CustomTypedDict2:'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE -consider-using-alias:69:12:69:16:CustomDataClass:'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE +consider-using-alias:22:6:22:17::'typing.Dict' will be deprecated with PY39, consider using 'dict' instead:INFERENCE +consider-using-alias:23:6:23:10::'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE +consider-using-alias:25:6:25:24::'typing.OrderedDict' will be deprecated with PY39, consider using 'collections.OrderedDict' instead:INFERENCE +consider-using-alias:26:6:26:22::'typing.Awaitable' will be deprecated with PY39, consider using 'collections.abc.Awaitable' instead:INFERENCE +consider-using-alias:27:6:27:21::'typing.Iterable' will be deprecated with PY39, consider using 'collections.abc.Iterable' instead:INFERENCE +consider-using-alias:28:6:28:21::'typing.Hashable' will be deprecated with PY39, consider using 'collections.abc.Hashable' instead:INFERENCE +consider-using-alias:29:6:29:27::'typing.ContextManager' will be deprecated with PY39, consider using 'contextlib.AbstractContextManager' instead:INFERENCE +consider-using-alias:30:6:30:20::'typing.Pattern' will be deprecated with PY39, consider using 're.Pattern' instead:INFERENCE +consider-using-alias:31:7:31:22::'typing.Match' will be deprecated with PY39, consider using 're.Match' instead:INFERENCE +consider-using-alias:40:9:40:13::'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE +consider-using-alias:42:7:42:11::'typing.Type' will be deprecated with PY39, consider using 'type' instead:INFERENCE +consider-using-alias:43:7:43:12::'typing.Tuple' will be deprecated with PY39, consider using 'tuple' instead:INFERENCE +consider-using-alias:44:7:44:15::'typing.Callable' will be deprecated with PY39, consider using 'collections.abc.Callable' instead:INFERENCE +consider-using-alias:50:74:50:78:func1:'typing.Dict' will be deprecated with PY39, consider using 'dict' instead:INFERENCE +consider-using-alias:50:16:50:20:func1:'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE +consider-using-alias:50:37:50:41:func1:'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE +consider-using-alias:50:93:50:105:func1:'typing.Tuple' will be deprecated with PY39, consider using 'tuple' instead:INFERENCE +consider-using-alias:66:12:66:16:CustomNamedTuple:'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE +consider-using-alias:71:12:71:16:CustomTypedDict2:'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE +consider-using-alias:75:12:75:16:CustomDataClass:'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE diff --git a/tests/functional/ext/typing/typing_consider_using_alias_without_future.py b/tests/functional/ext/typing/typing_consider_using_alias_without_future.py index 17daab9939..943a161887 100644 --- a/tests/functional/ext/typing/typing_consider_using_alias_without_future.py +++ b/tests/functional/ext/typing/typing_consider_using_alias_without_future.py @@ -2,7 +2,14 @@ 'py-version' needs to be set to '3.7' or '3.8' and 'runtime-typing=no'. """ -# pylint: disable=missing-docstring,invalid-name,unused-argument,line-too-long,unsubscriptable-object,unnecessary-direct-lambda-call + +# pylint: disable=missing-docstring,invalid-name,unused-argument,line-too-long,unsubscriptable-object +# pylint: disable=unnecessary-direct-lambda-call + +# Disabled because of a bug with pypy 3.8 see +# https://github.com/PyCQA/pylint/pull/7918#issuecomment-1352737369 +# pylint: disable=multiple-statements + import collections import collections.abc import typing diff --git a/tests/functional/ext/typing/typing_consider_using_alias_without_future.txt b/tests/functional/ext/typing/typing_consider_using_alias_without_future.txt index d7ed5fc845..7cf15a63c8 100644 --- a/tests/functional/ext/typing/typing_consider_using_alias_without_future.txt +++ b/tests/functional/ext/typing/typing_consider_using_alias_without_future.txt @@ -1,20 +1,20 @@ -consider-using-alias:13:6:13:17::'typing.Dict' will be deprecated with PY39, consider using 'dict' instead. Add 'from __future__ import annotations' as well:INFERENCE -consider-using-alias:14:6:14:10::'typing.List' will be deprecated with PY39, consider using 'list' instead. Add 'from __future__ import annotations' as well:INFERENCE -consider-using-alias:16:6:16:24::'typing.OrderedDict' will be deprecated with PY39, consider using 'collections.OrderedDict' instead. Add 'from __future__ import annotations' as well:INFERENCE -consider-using-alias:17:6:17:22::'typing.Awaitable' will be deprecated with PY39, consider using 'collections.abc.Awaitable' instead. Add 'from __future__ import annotations' as well:INFERENCE -consider-using-alias:18:6:18:21::'typing.Iterable' will be deprecated with PY39, consider using 'collections.abc.Iterable' instead. Add 'from __future__ import annotations' as well:INFERENCE -consider-using-alias:19:6:19:21::'typing.Hashable' will be deprecated with PY39, consider using 'collections.abc.Hashable' instead:INFERENCE -consider-using-alias:20:6:20:27::'typing.ContextManager' will be deprecated with PY39, consider using 'contextlib.AbstractContextManager' instead. Add 'from __future__ import annotations' as well:INFERENCE -consider-using-alias:21:6:21:20::'typing.Pattern' will be deprecated with PY39, consider using 're.Pattern' instead. Add 'from __future__ import annotations' as well:INFERENCE -consider-using-alias:22:7:22:22::'typing.Match' will be deprecated with PY39, consider using 're.Match' instead. Add 'from __future__ import annotations' as well:INFERENCE -consider-using-alias:31:9:31:13::'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE -consider-using-alias:33:7:33:11::'typing.Type' will be deprecated with PY39, consider using 'type' instead. Add 'from __future__ import annotations' as well:INFERENCE -consider-using-alias:34:7:34:12::'typing.Tuple' will be deprecated with PY39, consider using 'tuple' instead. Add 'from __future__ import annotations' as well:INFERENCE -consider-using-alias:35:7:35:15::'typing.Callable' will be deprecated with PY39, consider using 'collections.abc.Callable' instead. Add 'from __future__ import annotations' as well:INFERENCE -consider-using-alias:41:74:41:78:func1:'typing.Dict' will be deprecated with PY39, consider using 'dict' instead. Add 'from __future__ import annotations' as well:INFERENCE -consider-using-alias:41:16:41:20:func1:'typing.List' will be deprecated with PY39, consider using 'list' instead. Add 'from __future__ import annotations' as well:INFERENCE -consider-using-alias:41:37:41:41:func1:'typing.List' will be deprecated with PY39, consider using 'list' instead. Add 'from __future__ import annotations' as well:INFERENCE -consider-using-alias:41:93:41:105:func1:'typing.Tuple' will be deprecated with PY39, consider using 'tuple' instead. Add 'from __future__ import annotations' as well:INFERENCE -consider-using-alias:57:12:57:16:CustomNamedTuple:'typing.List' will be deprecated with PY39, consider using 'list' instead. Add 'from __future__ import annotations' as well:INFERENCE -consider-using-alias:62:12:62:16:CustomTypedDict2:'typing.List' will be deprecated with PY39, consider using 'list' instead. Add 'from __future__ import annotations' as well:INFERENCE -consider-using-alias:66:12:66:16:CustomDataClass:'typing.List' will be deprecated with PY39, consider using 'list' instead. Add 'from __future__ import annotations' as well:INFERENCE +consider-using-alias:20:6:20:17::'typing.Dict' will be deprecated with PY39, consider using 'dict' instead. Add 'from __future__ import annotations' as well:INFERENCE +consider-using-alias:21:6:21:10::'typing.List' will be deprecated with PY39, consider using 'list' instead. Add 'from __future__ import annotations' as well:INFERENCE +consider-using-alias:23:6:23:24::'typing.OrderedDict' will be deprecated with PY39, consider using 'collections.OrderedDict' instead. Add 'from __future__ import annotations' as well:INFERENCE +consider-using-alias:24:6:24:22::'typing.Awaitable' will be deprecated with PY39, consider using 'collections.abc.Awaitable' instead. Add 'from __future__ import annotations' as well:INFERENCE +consider-using-alias:25:6:25:21::'typing.Iterable' will be deprecated with PY39, consider using 'collections.abc.Iterable' instead. Add 'from __future__ import annotations' as well:INFERENCE +consider-using-alias:26:6:26:21::'typing.Hashable' will be deprecated with PY39, consider using 'collections.abc.Hashable' instead:INFERENCE +consider-using-alias:27:6:27:27::'typing.ContextManager' will be deprecated with PY39, consider using 'contextlib.AbstractContextManager' instead. Add 'from __future__ import annotations' as well:INFERENCE +consider-using-alias:28:6:28:20::'typing.Pattern' will be deprecated with PY39, consider using 're.Pattern' instead. Add 'from __future__ import annotations' as well:INFERENCE +consider-using-alias:29:7:29:22::'typing.Match' will be deprecated with PY39, consider using 're.Match' instead. Add 'from __future__ import annotations' as well:INFERENCE +consider-using-alias:38:9:38:13::'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE +consider-using-alias:40:7:40:11::'typing.Type' will be deprecated with PY39, consider using 'type' instead. Add 'from __future__ import annotations' as well:INFERENCE +consider-using-alias:41:7:41:12::'typing.Tuple' will be deprecated with PY39, consider using 'tuple' instead. Add 'from __future__ import annotations' as well:INFERENCE +consider-using-alias:42:7:42:15::'typing.Callable' will be deprecated with PY39, consider using 'collections.abc.Callable' instead. Add 'from __future__ import annotations' as well:INFERENCE +consider-using-alias:48:74:48:78:func1:'typing.Dict' will be deprecated with PY39, consider using 'dict' instead. Add 'from __future__ import annotations' as well:INFERENCE +consider-using-alias:48:16:48:20:func1:'typing.List' will be deprecated with PY39, consider using 'list' instead. Add 'from __future__ import annotations' as well:INFERENCE +consider-using-alias:48:37:48:41:func1:'typing.List' will be deprecated with PY39, consider using 'list' instead. Add 'from __future__ import annotations' as well:INFERENCE +consider-using-alias:48:93:48:105:func1:'typing.Tuple' will be deprecated with PY39, consider using 'tuple' instead. Add 'from __future__ import annotations' as well:INFERENCE +consider-using-alias:64:12:64:16:CustomNamedTuple:'typing.List' will be deprecated with PY39, consider using 'list' instead. Add 'from __future__ import annotations' as well:INFERENCE +consider-using-alias:69:12:69:16:CustomTypedDict2:'typing.List' will be deprecated with PY39, consider using 'list' instead. Add 'from __future__ import annotations' as well:INFERENCE +consider-using-alias:73:12:73:16:CustomDataClass:'typing.List' will be deprecated with PY39, consider using 'list' instead. Add 'from __future__ import annotations' as well:INFERENCE diff --git a/tests/functional/ext/typing/typing_consider_using_union.py b/tests/functional/ext/typing/typing_consider_using_union.py index bb92e6fc70..780a961000 100644 --- a/tests/functional/ext/typing/typing_consider_using_union.py +++ b/tests/functional/ext/typing/typing_consider_using_union.py @@ -3,8 +3,14 @@ 'py-version' needs to be set to >= '3.7' and 'runtime-typing=no'. With 'from __future__ import annotations' present. """ + # pylint: disable=missing-docstring,invalid-name,unused-argument,line-too-long # pylint: disable=consider-using-alias,unnecessary-direct-lambda-call + +# Disabled because of a bug with pypy 3.8 see +# https://github.com/PyCQA/pylint/pull/7918#issuecomment-1352737369 +# pylint: disable=multiple-statements + from __future__ import annotations from dataclasses import dataclass import typing diff --git a/tests/functional/ext/typing/typing_consider_using_union.txt b/tests/functional/ext/typing/typing_consider_using_union.txt index 4a1e7521d2..5f2746815f 100644 --- a/tests/functional/ext/typing/typing_consider_using_union.txt +++ b/tests/functional/ext/typing/typing_consider_using_union.txt @@ -1,10 +1,10 @@ -consider-alternative-union-syntax:13:6:13:11::Consider using alternative Union syntax instead of 'Union':INFERENCE -consider-alternative-union-syntax:14:11:14:16::Consider using alternative Union syntax instead of 'Union':INFERENCE -consider-alternative-union-syntax:15:16:15:28::Consider using alternative Union syntax instead of 'Union':INFERENCE -consider-alternative-union-syntax:16:6:16:14::Consider using alternative Union syntax instead of 'Optional':INFERENCE -consider-alternative-union-syntax:24:10:24:18:func1:Consider using alternative Union syntax instead of 'Optional':INFERENCE -consider-alternative-union-syntax:25:24:25:29:func1:Consider using alternative Union syntax instead of 'Union':INFERENCE -consider-alternative-union-syntax:26:5:26:10:func1:Consider using alternative Union syntax instead of 'Union':INFERENCE -consider-alternative-union-syntax:38:12:38:17:CustomNamedTuple:Consider using alternative Union syntax instead of 'Union':INFERENCE -consider-alternative-union-syntax:43:27:43:32:CustomTypedDict2:Consider using alternative Union syntax instead of 'Union':INFERENCE -consider-alternative-union-syntax:47:12:47:20:CustomDataClass:Consider using alternative Union syntax instead of 'Optional':INFERENCE +consider-alternative-union-syntax:19:6:19:11::Consider using alternative Union syntax instead of 'Union':INFERENCE +consider-alternative-union-syntax:20:11:20:16::Consider using alternative Union syntax instead of 'Union':INFERENCE +consider-alternative-union-syntax:21:16:21:28::Consider using alternative Union syntax instead of 'Union':INFERENCE +consider-alternative-union-syntax:22:6:22:14::Consider using alternative Union syntax instead of 'Optional':INFERENCE +consider-alternative-union-syntax:30:10:30:18:func1:Consider using alternative Union syntax instead of 'Optional':INFERENCE +consider-alternative-union-syntax:31:24:31:29:func1:Consider using alternative Union syntax instead of 'Union':INFERENCE +consider-alternative-union-syntax:32:5:32:10:func1:Consider using alternative Union syntax instead of 'Union':INFERENCE +consider-alternative-union-syntax:44:12:44:17:CustomNamedTuple:Consider using alternative Union syntax instead of 'Union':INFERENCE +consider-alternative-union-syntax:49:27:49:32:CustomTypedDict2:Consider using alternative Union syntax instead of 'Union':INFERENCE +consider-alternative-union-syntax:53:12:53:20:CustomDataClass:Consider using alternative Union syntax instead of 'Optional':INFERENCE diff --git a/tests/functional/ext/typing/typing_consider_using_union_without_future.py b/tests/functional/ext/typing/typing_consider_using_union_without_future.py index 1fb43c65ac..d29ba306e9 100644 --- a/tests/functional/ext/typing/typing_consider_using_union_without_future.py +++ b/tests/functional/ext/typing/typing_consider_using_union_without_future.py @@ -2,8 +2,14 @@ 'py-version' needs to be set to >= '3.7' and 'runtime-typing=no'. """ + # pylint: disable=missing-docstring,invalid-name,unused-argument,line-too-long,unnecessary-direct-lambda-call # pylint: disable=consider-using-alias + +# Disabled because of a bug with pypy 3.8 see +# https://github.com/PyCQA/pylint/pull/7918#issuecomment-1352737369 +# pylint: disable=multiple-statements + from dataclasses import dataclass import typing from typing import Dict, List, Optional, Union, TypedDict diff --git a/tests/functional/ext/typing/typing_consider_using_union_without_future.txt b/tests/functional/ext/typing/typing_consider_using_union_without_future.txt index bc8ca4c075..5d48e9afca 100644 --- a/tests/functional/ext/typing/typing_consider_using_union_without_future.txt +++ b/tests/functional/ext/typing/typing_consider_using_union_without_future.txt @@ -1,10 +1,10 @@ -consider-alternative-union-syntax:11:6:11:11::Consider using alternative Union syntax instead of 'Union'. Add 'from __future__ import annotations' as well:INFERENCE -consider-alternative-union-syntax:12:11:12:16::Consider using alternative Union syntax instead of 'Union'. Add 'from __future__ import annotations' as well:INFERENCE -consider-alternative-union-syntax:13:16:13:28::Consider using alternative Union syntax instead of 'Union'. Add 'from __future__ import annotations' as well:INFERENCE -consider-alternative-union-syntax:14:6:14:14::Consider using alternative Union syntax instead of 'Optional'. Add 'from __future__ import annotations' as well:INFERENCE -consider-alternative-union-syntax:22:10:22:18:func1:Consider using alternative Union syntax instead of 'Optional'. Add 'from __future__ import annotations' as well:INFERENCE -consider-alternative-union-syntax:23:24:23:29:func1:Consider using alternative Union syntax instead of 'Union'. Add 'from __future__ import annotations' as well:INFERENCE -consider-alternative-union-syntax:24:5:24:10:func1:Consider using alternative Union syntax instead of 'Union'. Add 'from __future__ import annotations' as well:INFERENCE -consider-alternative-union-syntax:36:12:36:17:CustomNamedTuple:Consider using alternative Union syntax instead of 'Union'. Add 'from __future__ import annotations' as well:INFERENCE -consider-alternative-union-syntax:41:27:41:32:CustomTypedDict2:Consider using alternative Union syntax instead of 'Union'. Add 'from __future__ import annotations' as well:INFERENCE -consider-alternative-union-syntax:45:12:45:20:CustomDataClass:Consider using alternative Union syntax instead of 'Optional'. Add 'from __future__ import annotations' as well:INFERENCE +consider-alternative-union-syntax:17:6:17:11::Consider using alternative Union syntax instead of 'Union'. Add 'from __future__ import annotations' as well:INFERENCE +consider-alternative-union-syntax:18:11:18:16::Consider using alternative Union syntax instead of 'Union'. Add 'from __future__ import annotations' as well:INFERENCE +consider-alternative-union-syntax:19:16:19:28::Consider using alternative Union syntax instead of 'Union'. Add 'from __future__ import annotations' as well:INFERENCE +consider-alternative-union-syntax:20:6:20:14::Consider using alternative Union syntax instead of 'Optional'. Add 'from __future__ import annotations' as well:INFERENCE +consider-alternative-union-syntax:28:10:28:18:func1:Consider using alternative Union syntax instead of 'Optional'. Add 'from __future__ import annotations' as well:INFERENCE +consider-alternative-union-syntax:29:24:29:29:func1:Consider using alternative Union syntax instead of 'Union'. Add 'from __future__ import annotations' as well:INFERENCE +consider-alternative-union-syntax:30:5:30:10:func1:Consider using alternative Union syntax instead of 'Union'. Add 'from __future__ import annotations' as well:INFERENCE +consider-alternative-union-syntax:42:12:42:17:CustomNamedTuple:Consider using alternative Union syntax instead of 'Union'. Add 'from __future__ import annotations' as well:INFERENCE +consider-alternative-union-syntax:47:27:47:32:CustomTypedDict2:Consider using alternative Union syntax instead of 'Union'. Add 'from __future__ import annotations' as well:INFERENCE +consider-alternative-union-syntax:51:12:51:20:CustomDataClass:Consider using alternative Union syntax instead of 'Optional'. Add 'from __future__ import annotations' as well:INFERENCE diff --git a/tests/functional/i/invalid/invalid_metaclass.py b/tests/functional/i/invalid/invalid_metaclass.py index 1dc59791af..3b264d693e 100644 --- a/tests/functional/i/invalid/invalid_metaclass.py +++ b/tests/functional/i/invalid/invalid_metaclass.py @@ -1,5 +1,9 @@ # pylint: disable=missing-docstring, too-few-public-methods, import-error,unused-argument +# Disabled because of a bug with pypy 3.8 see +# https://github.com/PyCQA/pylint/pull/7918#issuecomment-1352737369 +# pylint: disable=multiple-statements + import abc import six diff --git a/tests/functional/i/invalid/invalid_metaclass.txt b/tests/functional/i/invalid/invalid_metaclass.txt index 006065705e..21b31f3c6e 100644 --- a/tests/functional/i/invalid/invalid_metaclass.txt +++ b/tests/functional/i/invalid/invalid_metaclass.txt @@ -1,6 +1,6 @@ -invalid-metaclass:37:0:37:18:FirstInvalid:Invalid metaclass 'int' used:UNDEFINED -invalid-metaclass:41:0:41:19:SecondInvalid:Invalid metaclass 'InvalidAsMetaclass' used:UNDEFINED -invalid-metaclass:45:0:45:18:ThirdInvalid:Invalid metaclass '2' used:UNDEFINED -invalid-metaclass:49:0:49:19:FourthInvalid:Invalid metaclass 'Instance of invalid_metaclass.InvalidAsMetaclass' used:UNDEFINED -invalid-metaclass:61:0:61:13:Invalid:Invalid metaclass 'int' used:UNDEFINED -invalid-metaclass:65:0:65:19:InvalidSecond:Invalid metaclass '1' used:UNDEFINED +invalid-metaclass:41:0:41:18:FirstInvalid:Invalid metaclass 'int' used:UNDEFINED +invalid-metaclass:45:0:45:19:SecondInvalid:Invalid metaclass 'InvalidAsMetaclass' used:UNDEFINED +invalid-metaclass:49:0:49:18:ThirdInvalid:Invalid metaclass '2' used:UNDEFINED +invalid-metaclass:53:0:53:19:FourthInvalid:Invalid metaclass 'Instance of invalid_metaclass.InvalidAsMetaclass' used:UNDEFINED +invalid-metaclass:65:0:65:13:Invalid:Invalid metaclass 'int' used:UNDEFINED +invalid-metaclass:69:0:69:19:InvalidSecond:Invalid metaclass '1' used:UNDEFINED diff --git a/tests/functional/i/invalid/invalid_sequence_index.py b/tests/functional/i/invalid/invalid_sequence_index.py index ec12b6e947..4bc1c0fe60 100644 --- a/tests/functional/i/invalid/invalid_sequence_index.py +++ b/tests/functional/i/invalid/invalid_sequence_index.py @@ -1,5 +1,9 @@ -"""Errors for invalid sequence indices""" # pylint: disable=too-few-public-methods, import-error, missing-docstring, unnecessary-pass + +# Disabled because of a bug with pypy 3.8 see +# https://github.com/PyCQA/pylint/pull/7918#issuecomment-1352737369 +# pylint: disable=multiple-statements + import six from unknown import Unknown diff --git a/tests/functional/i/invalid/invalid_sequence_index.txt b/tests/functional/i/invalid/invalid_sequence_index.txt index dc04046bee..81758b446d 100644 --- a/tests/functional/i/invalid/invalid_sequence_index.txt +++ b/tests/functional/i/invalid/invalid_sequence_index.txt @@ -1,19 +1,19 @@ -invalid-sequence-index:13:11:13:23:function1:Sequence index is not an int, slice, or instance with __index__:UNDEFINED -invalid-sequence-index:17:11:17:25:function2:Sequence index is not an int, slice, or instance with __index__:UNDEFINED -invalid-sequence-index:21:11:21:29:function3:Sequence index is not an int, slice, or instance with __index__:UNDEFINED -invalid-sequence-index:25:11:25:24:function4:Sequence index is not an int, slice, or instance with __index__:UNDEFINED -invalid-sequence-index:33:11:33:35:function5:Sequence index is not an int, slice, or instance with __index__:UNDEFINED -invalid-sequence-index:37:11:37:26:function6:Sequence index is not an int, slice, or instance with __index__:UNDEFINED -invalid-sequence-index:41:11:41:24:function7:Sequence index is not an int, slice, or instance with __index__:UNDEFINED -invalid-sequence-index:48:11:48:28:function8:Sequence index is not an int, slice, or instance with __index__:UNDEFINED -invalid-sequence-index:128:4:128:18:function19:Sequence index is not an int, slice, or instance with __index__:UNDEFINED -invalid-sequence-index:133:8:133:22:function20:Sequence index is not an int, slice, or instance with __index__:UNDEFINED -invalid-sequence-index:144:4:144:14:function21:Sequence index is not an int, slice, or instance with __index__:UNDEFINED -invalid-sequence-index:145:8:145:18:function21:Sequence index is not an int, slice, or instance with __index__:UNDEFINED -invalid-sequence-index:160:4:160:14:function22:Sequence index is not an int, slice, or instance with __index__:UNDEFINED -invalid-sequence-index:162:8:162:18:function22:Sequence index is not an int, slice, or instance with __index__:UNDEFINED -invalid-sequence-index:178:4:178:14:function23:Sequence index is not an int, slice, or instance with __index__:UNDEFINED -invalid-sequence-index:180:4:180:14:function23:Sequence index is not an int, slice, or instance with __index__:UNDEFINED -invalid-sequence-index:196:4:196:14:function24:Sequence index is not an int, slice, or instance with __index__:UNDEFINED -invalid-sequence-index:198:8:198:18:function24:Sequence index is not an int, slice, or instance with __index__:UNDEFINED -invalid-sequence-index:208:11:208:27:function25:Sequence index is not an int, slice, or instance with __index__:UNDEFINED +invalid-sequence-index:17:11:17:23:function1:Sequence index is not an int, slice, or instance with __index__:UNDEFINED +invalid-sequence-index:21:11:21:25:function2:Sequence index is not an int, slice, or instance with __index__:UNDEFINED +invalid-sequence-index:25:11:25:29:function3:Sequence index is not an int, slice, or instance with __index__:UNDEFINED +invalid-sequence-index:29:11:29:24:function4:Sequence index is not an int, slice, or instance with __index__:UNDEFINED +invalid-sequence-index:37:11:37:35:function5:Sequence index is not an int, slice, or instance with __index__:UNDEFINED +invalid-sequence-index:41:11:41:26:function6:Sequence index is not an int, slice, or instance with __index__:UNDEFINED +invalid-sequence-index:45:11:45:24:function7:Sequence index is not an int, slice, or instance with __index__:UNDEFINED +invalid-sequence-index:52:11:52:28:function8:Sequence index is not an int, slice, or instance with __index__:UNDEFINED +invalid-sequence-index:132:4:132:18:function19:Sequence index is not an int, slice, or instance with __index__:UNDEFINED +invalid-sequence-index:137:8:137:22:function20:Sequence index is not an int, slice, or instance with __index__:UNDEFINED +invalid-sequence-index:148:4:148:14:function21:Sequence index is not an int, slice, or instance with __index__:UNDEFINED +invalid-sequence-index:149:8:149:18:function21:Sequence index is not an int, slice, or instance with __index__:UNDEFINED +invalid-sequence-index:164:4:164:14:function22:Sequence index is not an int, slice, or instance with __index__:UNDEFINED +invalid-sequence-index:166:8:166:18:function22:Sequence index is not an int, slice, or instance with __index__:UNDEFINED +invalid-sequence-index:182:4:182:14:function23:Sequence index is not an int, slice, or instance with __index__:UNDEFINED +invalid-sequence-index:184:4:184:14:function23:Sequence index is not an int, slice, or instance with __index__:UNDEFINED +invalid-sequence-index:200:4:200:14:function24:Sequence index is not an int, slice, or instance with __index__:UNDEFINED +invalid-sequence-index:202:8:202:18:function24:Sequence index is not an int, slice, or instance with __index__:UNDEFINED +invalid-sequence-index:212:11:212:27:function25:Sequence index is not an int, slice, or instance with __index__:UNDEFINED diff --git a/tests/functional/n/no/no_member_dataclasses.py b/tests/functional/n/no/no_member_dataclasses.py index 972da9ad91..97528e6984 100644 --- a/tests/functional/n/no/no_member_dataclasses.py +++ b/tests/functional/n/no/no_member_dataclasses.py @@ -1,6 +1,11 @@ -"""Test various regressions for dataclasses and no-member. -""" +"""Test various regressions for dataclasses and no-member.""" + # pylint: disable=missing-docstring, too-few-public-methods + +# Disabled because of a bug with pypy 3.8 see +# https://github.com/PyCQA/pylint/pull/7918#issuecomment-1352737369 +# pylint: disable=multiple-statements + from abc import ABCMeta, abstractmethod from dataclasses import asdict, dataclass, field from typing import Any, Dict diff --git a/tests/functional/n/no/no_member_dataclasses.txt b/tests/functional/n/no/no_member_dataclasses.txt index ee33c10fbf..bf91fc84f1 100644 --- a/tests/functional/n/no/no_member_dataclasses.txt +++ b/tests/functional/n/no/no_member_dataclasses.txt @@ -1,2 +1,2 @@ -no-member:69:26:69:46:TestClass2.some_func:Instance of 'Field' has no 'items' member:INFERENCE -no-member:81:26:81:46:TestClass3.some_func:Instance of 'Field' has no 'items' member:INFERENCE +no-member:74:26:74:46:TestClass2.some_func:Instance of 'Field' has no 'items' member:INFERENCE +no-member:86:26:86:46:TestClass3.some_func:Instance of 'Field' has no 'items' member:INFERENCE diff --git a/tests/functional/n/no/no_member_subclassed_dataclasses.py b/tests/functional/n/no/no_member_subclassed_dataclasses.py index 918abc5dbc..0dee108407 100644 --- a/tests/functional/n/no/no_member_subclassed_dataclasses.py +++ b/tests/functional/n/no/no_member_subclassed_dataclasses.py @@ -1,3 +1,10 @@ +# pylint: disable=fixme,logging-too-many-args,logging-fstring-interpolation,missing-docstring,no-else-return +# pylint: disable=too-few-public-methods + +# Disabled because of a bug with pypy 3.8 see +# https://github.com/PyCQA/pylint/pull/7918#issuecomment-1352737369 +# pylint: disable=multiple-statements + from abc import ABCMeta, abstractmethod import dataclasses as dc from typing import Any, Dict diff --git a/tests/functional/n/no/no_member_subclassed_dataclasses.rc b/tests/functional/n/no/no_member_subclassed_dataclasses.rc index d115e39866..a17bb22daf 100644 --- a/tests/functional/n/no/no_member_subclassed_dataclasses.rc +++ b/tests/functional/n/no/no_member_subclassed_dataclasses.rc @@ -1,10 +1,2 @@ [testoptions] min_pyver=3.7 - -[MESSAGES CONTROL] -disable=fixme, - logging-too-many-args, - logging-fstring-interpolation, - missing-docstring, - no-else-return, - too-few-public-methods, diff --git a/tests/functional/p/postponed_evaluation_pep585.py b/tests/functional/p/postponed_evaluation_pep585.py index 9537fccefd..1d539126d7 100644 --- a/tests/functional/p/postponed_evaluation_pep585.py +++ b/tests/functional/p/postponed_evaluation_pep585.py @@ -3,7 +3,15 @@ This check requires Python 3.7 or 3.8! Testing with 3.8 only, to support TypedDict. """ -# pylint: disable=missing-docstring,unused-argument,unused-import,too-few-public-methods,invalid-name,inherit-non-class,unsupported-binary-operation,wrong-import-position,ungrouped-imports,unused-variable,unnecessary-direct-lambda-call + +# pylint: disable=missing-docstring,unused-argument,unused-import,too-few-public-methods,invalid-name +# pylint: disable=inherit-non-class,unsupported-binary-operation,wrong-import-position,ungrouped-imports +# pylint: disable=unused-variable,unnecessary-direct-lambda-call + +# Disabled because of a bug with pypy 3.8 see +# https://github.com/PyCQA/pylint/pull/7918#issuecomment-1352737369 +# pylint: disable=multiple-statements + from __future__ import annotations import collections import dataclasses diff --git a/tests/functional/p/postponed_evaluation_pep585.txt b/tests/functional/p/postponed_evaluation_pep585.txt index 7e0d0d163c..899dc59774 100644 --- a/tests/functional/p/postponed_evaluation_pep585.txt +++ b/tests/functional/p/postponed_evaluation_pep585.txt @@ -1,19 +1,19 @@ -unsubscriptable-object:15:15:15:19::Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:20:25:20:29:CustomIntListError:Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:24:28:24:32::Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:26:24:26:28::Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:28:14:28:18::Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:33:36:33:40::Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:43:54:43:58::Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:45:60:45:64::Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:96:15:96:19::Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:97:21:97:25::Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:98:15:98:19::Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:99:19:99:23::Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:100:15:100:19::Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:101:9:101:13::Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:101:14:101:18::Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:121:20:121:24:func3:Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:123:33:123:37:func3:Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:126:14:126:18:func4:Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:129:32:129:35:func5:Value 'set' is unsubscriptable:UNDEFINED +unsubscriptable-object:23:15:23:19::Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:28:25:28:29:CustomIntListError:Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:32:28:32:32::Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:34:24:34:28::Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:36:14:36:18::Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:41:36:41:40::Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:51:54:51:58::Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:53:60:53:64::Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:104:15:104:19::Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:105:21:105:25::Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:106:15:106:19::Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:107:19:107:23::Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:108:15:108:19::Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:109:9:109:13::Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:109:14:109:18::Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:129:20:129:24:func3:Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:131:33:131:37:func3:Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:134:14:134:18:func4:Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:137:32:137:35:func5:Value 'set' is unsubscriptable:UNDEFINED diff --git a/tests/functional/p/postponed_evaluation_pep585_error.py b/tests/functional/p/postponed_evaluation_pep585_error.py index 7c117e33e4..19153105ea 100644 --- a/tests/functional/p/postponed_evaluation_pep585_error.py +++ b/tests/functional/p/postponed_evaluation_pep585_error.py @@ -3,7 +3,15 @@ This check requires Python 3.7 or Python 3.8! Testing with 3.8 only, to support TypedDict. """ -# pylint: disable=missing-docstring,unused-argument,unused-import,too-few-public-methods,invalid-name,inherit-non-class,unsupported-binary-operation,unused-variable,line-too-long,unnecessary-direct-lambda-call + +# pylint: disable=missing-docstring,unused-argument,unused-import,too-few-public-methods +# pylint: disable=invalid-name,inherit-non-class,unsupported-binary-operation +# pylint: disable=unused-variable,line-too-long,unnecessary-direct-lambda-call + +# Disabled because of a bug with pypy 3.8 see +# https://github.com/PyCQA/pylint/pull/7918#issuecomment-1352737369 +# pylint: disable=multiple-statements + import collections import dataclasses import typing diff --git a/tests/functional/p/postponed_evaluation_pep585_error.txt b/tests/functional/p/postponed_evaluation_pep585_error.txt index 4fe18301f4..406081dfae 100644 --- a/tests/functional/p/postponed_evaluation_pep585_error.txt +++ b/tests/functional/p/postponed_evaluation_pep585_error.txt @@ -1,49 +1,49 @@ -unsubscriptable-object:14:15:14:19::Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:19:25:19:29:CustomIntListError:Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:23:28:23:32::Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:25:24:25:28::Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:27:14:27:18::Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:32:36:32:40::Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:35:12:35:16:CustomNamedTuple2:Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:38:12:38:16:CustomNamedTuple3:Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:42:54:42:58::Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:44:60:44:64::Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:47:12:47:16:CustomTypedDict3:Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:50:12:50:16:CustomTypedDict4:Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:61:12:61:16:CustomDataClass:Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:65:12:65:16:CustomDataClass2:Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:69:12:69:16:CustomDataClass3:Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:74:12:74:16:CustomDataClass4:Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:77:6:77:9::Value 'set' is unsubscriptable:UNDEFINED -unsubscriptable-object:78:6:78:29::Value 'collections.OrderedDict' is unsubscriptable:UNDEFINED -unsubscriptable-object:79:6:79:10::Value 'dict' is unsubscriptable:UNDEFINED -unsubscriptable-object:79:16:79:20::Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:80:16:80:20::Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:81:6:81:10::Value 'dict' is unsubscriptable:UNDEFINED -unsubscriptable-object:81:11:81:16::Value 'tuple' is unsubscriptable:UNDEFINED -unsubscriptable-object:82:11:82:16::Value 'tuple' is unsubscriptable:UNDEFINED -unsubscriptable-object:83:6:83:10::Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:83:11:83:15::Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:84:12:84:16::Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:84:6:84:11::Value 'tuple' is unsubscriptable:UNDEFINED -unsubscriptable-object:85:12:85:16::Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:86:13:86:17::Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:87:19:87:23::Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:89:14:89:18:func:Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:92:15:92:19:func2:Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:95:15:95:19::Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:96:21:96:25::Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:97:19:97:23::Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:98:15:98:19::Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:99:9:99:13::Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:99:14:99:18::Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:103:20:103:24:func3:Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:105:33:105:37:func3:Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:106:11:106:15:func3:Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:108:14:108:18:func4:Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:111:16:111:20:func5:Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:111:32:111:35:func5:Value 'set' is unsubscriptable:UNDEFINED -unsubscriptable-object:114:75:114:79:func6:Value 'dict' is unsubscriptable:UNDEFINED -unsubscriptable-object:114:16:114:20:func6:Value 'list' is unsubscriptable:UNDEFINED -unsubscriptable-object:114:55:114:58:func6:Value 'set' is unsubscriptable:UNDEFINED -unsubscriptable-object:114:37:114:42:func6:Value 'tuple' is unsubscriptable:UNDEFINED +unsubscriptable-object:22:15:22:19::Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:27:25:27:29:CustomIntListError:Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:31:28:31:32::Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:33:24:33:28::Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:35:14:35:18::Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:40:36:40:40::Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:43:12:43:16:CustomNamedTuple2:Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:46:12:46:16:CustomNamedTuple3:Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:50:54:50:58::Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:52:60:52:64::Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:55:12:55:16:CustomTypedDict3:Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:58:12:58:16:CustomTypedDict4:Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:69:12:69:16:CustomDataClass:Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:73:12:73:16:CustomDataClass2:Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:77:12:77:16:CustomDataClass3:Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:82:12:82:16:CustomDataClass4:Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:85:6:85:9::Value 'set' is unsubscriptable:UNDEFINED +unsubscriptable-object:86:6:86:29::Value 'collections.OrderedDict' is unsubscriptable:UNDEFINED +unsubscriptable-object:87:6:87:10::Value 'dict' is unsubscriptable:UNDEFINED +unsubscriptable-object:87:16:87:20::Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:88:16:88:20::Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:89:6:89:10::Value 'dict' is unsubscriptable:UNDEFINED +unsubscriptable-object:89:11:89:16::Value 'tuple' is unsubscriptable:UNDEFINED +unsubscriptable-object:90:11:90:16::Value 'tuple' is unsubscriptable:UNDEFINED +unsubscriptable-object:91:6:91:10::Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:91:11:91:15::Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:92:12:92:16::Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:92:6:92:11::Value 'tuple' is unsubscriptable:UNDEFINED +unsubscriptable-object:93:12:93:16::Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:94:13:94:17::Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:95:19:95:23::Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:97:14:97:18:func:Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:100:15:100:19:func2:Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:103:15:103:19::Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:104:21:104:25::Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:105:19:105:23::Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:106:15:106:19::Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:107:9:107:13::Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:107:14:107:18::Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:111:20:111:24:func3:Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:113:33:113:37:func3:Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:114:11:114:15:func3:Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:116:14:116:18:func4:Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:119:16:119:20:func5:Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:119:32:119:35:func5:Value 'set' is unsubscriptable:UNDEFINED +unsubscriptable-object:122:75:122:79:func6:Value 'dict' is unsubscriptable:UNDEFINED +unsubscriptable-object:122:16:122:20:func6:Value 'list' is unsubscriptable:UNDEFINED +unsubscriptable-object:122:55:122:58:func6:Value 'set' is unsubscriptable:UNDEFINED +unsubscriptable-object:122:37:122:42:func6:Value 'tuple' is unsubscriptable:UNDEFINED diff --git a/tests/functional/r/redundant_unittest_assert.py b/tests/functional/r/redundant_unittest_assert.py index b7efffc4ee..aa41208312 100644 --- a/tests/functional/r/redundant_unittest_assert.py +++ b/tests/functional/r/redundant_unittest_assert.py @@ -1,13 +1,18 @@ -# pylint: disable=missing-docstring,too-few-public-methods """ -https://www.logilab.org/ticket/355 -If you are using assertTrue or assertFalse and the first argument is a -constant(like a string), then the assert will always be true. Therefore, -it should emit a warning message. +If you are using assertTrue or assertFalse and the first argument is a constant +(like a string), then the assert will always be true. Therefore, it should emit +a warning message. """ +# pylint: disable=missing-docstring,too-few-public-methods + +# Disabled because of a bug with pypy 3.8 see +# https://github.com/PyCQA/pylint/pull/7918#issuecomment-1352737369 +# pylint: disable=multiple-statements + import unittest + @unittest.skip("don't run this") class Tests(unittest.TestCase): def test_something(self): diff --git a/tests/functional/r/redundant_unittest_assert.txt b/tests/functional/r/redundant_unittest_assert.txt index 4c72539abd..44f9cb5206 100644 --- a/tests/functional/r/redundant_unittest_assert.txt +++ b/tests/functional/r/redundant_unittest_assert.txt @@ -1,6 +1,6 @@ -redundant-unittest-assert:17:8:17:71:Tests.test_something:Redundant use of assertTrue with constant value 'I meant assertEqual not assertTrue':UNDEFINED -redundant-unittest-assert:19:8:19:73:Tests.test_something:Redundant use of assertFalse with constant value 'I meant assertEqual not assertFalse':UNDEFINED -redundant-unittest-assert:21:8:21:39:Tests.test_something:Redundant use of assertTrue with constant value True:UNDEFINED -redundant-unittest-assert:23:8:23:41:Tests.test_something:Redundant use of assertFalse with constant value False:UNDEFINED -redundant-unittest-assert:25:8:25:40:Tests.test_something:Redundant use of assertFalse with constant value None:UNDEFINED -redundant-unittest-assert:27:8:27:36:Tests.test_something:Redundant use of assertTrue with constant value 0:UNDEFINED +redundant-unittest-assert:22:8:22:71:Tests.test_something:Redundant use of assertTrue with constant value 'I meant assertEqual not assertTrue':UNDEFINED +redundant-unittest-assert:24:8:24:73:Tests.test_something:Redundant use of assertFalse with constant value 'I meant assertEqual not assertFalse':UNDEFINED +redundant-unittest-assert:26:8:26:39:Tests.test_something:Redundant use of assertTrue with constant value True:UNDEFINED +redundant-unittest-assert:28:8:28:41:Tests.test_something:Redundant use of assertFalse with constant value False:UNDEFINED +redundant-unittest-assert:30:8:30:40:Tests.test_something:Redundant use of assertFalse with constant value None:UNDEFINED +redundant-unittest-assert:32:8:32:36:Tests.test_something:Redundant use of assertTrue with constant value 0:UNDEFINED diff --git a/tests/functional/r/regression/regression_4439.py b/tests/functional/r/regression/regression_4439.py index 966cc80067..257a20a866 100644 --- a/tests/functional/r/regression/regression_4439.py +++ b/tests/functional/r/regression/regression_4439.py @@ -1,6 +1,10 @@ """AttributeError: 'Subscript' object has no attribute 'name' """ # pylint: disable=missing-docstring +# Disabled because of a bug with pypy 3.8 see +# https://github.com/PyCQA/pylint/pull/7918#issuecomment-1352737369 +# pylint: disable=multiple-statements + from typing import Optional from attr import attrib, attrs @@ -10,4 +14,4 @@ class User: name: str = attrib() age: int = attrib() - occupation = Optional[str] = attrib(default=None) # [unsupported-assignment-operation] + occupation = Optional[str] = attrib(default=None) # [unsupported-assignment-operation] diff --git a/tests/functional/r/regression/regression_4439.txt b/tests/functional/r/regression/regression_4439.txt index 4e280a1afd..6db65057f7 100644 --- a/tests/functional/r/regression/regression_4439.txt +++ b/tests/functional/r/regression/regression_4439.txt @@ -1 +1 @@ -unsupported-assignment-operation:13:17:13:25:User:'Optional' does not support item assignment:UNDEFINED +unsupported-assignment-operation:17:17:17:25:User:'Optional' does not support item assignment:UNDEFINED diff --git a/tests/functional/s/subclassed_final_class_py38.py b/tests/functional/s/subclassed_final_class_py38.py index 60e9a76256..a4621d5324 100644 --- a/tests/functional/s/subclassed_final_class_py38.py +++ b/tests/functional/s/subclassed_final_class_py38.py @@ -1,8 +1,12 @@ """Since Python version 3.8, a class decorated with typing.final cannot be -subclassed """ +subclassed.""" # pylint: disable=missing-docstring, too-few-public-methods +# Disabled because of a bug with pypy 3.8 see +# https://github.com/PyCQA/pylint/pull/7918#issuecomment-1352737369 +# pylint: disable=multiple-statements + from typing import final @@ -11,5 +15,5 @@ class Base: pass -class Subclass(Base): # [subclassed-final-class] +class Subclass(Base): # [subclassed-final-class] pass diff --git a/tests/functional/s/subclassed_final_class_py38.txt b/tests/functional/s/subclassed_final_class_py38.txt index 9dec8110e8..4b73d2d986 100644 --- a/tests/functional/s/subclassed_final_class_py38.txt +++ b/tests/functional/s/subclassed_final_class_py38.txt @@ -1 +1 @@ -subclassed-final-class:14:0:14:14:Subclass:"Class 'Subclass' is a subclass of a class decorated with typing.final: 'Base'":UNDEFINED +subclassed-final-class:18:0:18:14:Subclass:"Class 'Subclass' is a subclass of a class decorated with typing.final: 'Base'":UNDEFINED diff --git a/tests/functional/t/too/too_few_public_methods_37.py b/tests/functional/t/too/too_few_public_methods_37.py index 55fc544840..3b63a8fecf 100644 --- a/tests/functional/t/too/too_few_public_methods_37.py +++ b/tests/functional/t/too/too_few_public_methods_37.py @@ -1,4 +1,9 @@ # pylint: disable=missing-docstring + +# Disabled because of a bug with pypy 3.8 see +# https://github.com/PyCQA/pylint/pull/7918#issuecomment-1352737369 +# pylint: disable=multiple-statements + import dataclasses import typing from dataclasses import dataclass diff --git a/tests/functional/t/too/too_many_instance_attributes.py b/tests/functional/t/too/too_many_instance_attributes.py index 73cbd736ba..3177dc8aa8 100644 --- a/tests/functional/t/too/too_many_instance_attributes.py +++ b/tests/functional/t/too/too_many_instance_attributes.py @@ -1,5 +1,9 @@ # pylint: disable=missing-docstring, too-few-public-methods +# Disabled because of a bug with pypy 3.8 see +# https://github.com/PyCQA/pylint/pull/7918#issuecomment-1352737369 +# pylint: disable=multiple-statements + class Aaaa: # [too-many-instance-attributes] diff --git a/tests/functional/t/too/too_many_instance_attributes.txt b/tests/functional/t/too/too_many_instance_attributes.txt index d3f1282228..4c67ec5a30 100644 --- a/tests/functional/t/too/too_many_instance_attributes.txt +++ b/tests/functional/t/too/too_many_instance_attributes.txt @@ -1 +1 @@ -too-many-instance-attributes:4:0:4:10:Aaaa:Too many instance attributes (21/7):UNDEFINED +too-many-instance-attributes:8:0:8:10:Aaaa:Too many instance attributes (21/7):UNDEFINED diff --git a/tests/functional/t/too/too_many_instance_attributes_py37.py b/tests/functional/t/too/too_many_instance_attributes_py37.py index 68e101892a..152bb1ca22 100644 --- a/tests/functional/t/too/too_many_instance_attributes_py37.py +++ b/tests/functional/t/too/too_many_instance_attributes_py37.py @@ -1,8 +1,17 @@ +""" +InitVars should not count as instance attributes (see issue #3754) +Default max_instance_attributes is 7 +""" + # pylint: disable=missing-docstring, too-few-public-methods + +# Disabled because of a bug with pypy 3.8 see +# https://github.com/PyCQA/pylint/pull/7918#issuecomment-1352737369 +# pylint: disable=multiple-statements + from dataclasses import dataclass, InitVar -# InitVars should not count as instance attributes (see issue #3754) -# Default max_instance_attributes is 7 + @dataclass class Hello: a_1: int diff --git a/tests/functional/u/unpacking/unpacking_non_sequence_py37.py b/tests/functional/u/unpacking/unpacking_non_sequence_py37.py index dd8af1136c..13ab35b9a9 100644 --- a/tests/functional/u/unpacking/unpacking_non_sequence_py37.py +++ b/tests/functional/u/unpacking/unpacking_non_sequence_py37.py @@ -1,6 +1,13 @@ +""" +https://github.com/PyCQA/pylint/issues/4895 +""" + # pylint: disable=missing-docstring -# https://github.com/PyCQA/pylint/issues/4895 +# Disabled because of a bug with pypy 3.8 see +# https://github.com/PyCQA/pylint/pull/7918#issuecomment-1352737369 +# pylint: disable=multiple-statements + from __future__ import annotations from collections.abc import Callable From 785c6291d56f4f043c0ee9d1c835a8241ed67d5a Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Thu, 15 Dec 2022 23:04:12 +0100 Subject: [PATCH 8/9] [testutil] More information in output for functional test fail (#7948) In order to help when the target interpreter is not installed locally and you can't update automatically yourself (pypy/old interpreters like python 3.7). Done for: Refs #7945 --- pylint/testutils/lint_module_test.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/pylint/testutils/lint_module_test.py b/pylint/testutils/lint_module_test.py index 0d3dbb0bf4..17decf8a5f 100644 --- a/pylint/testutils/lint_module_test.py +++ b/pylint/testutils/lint_module_test.py @@ -287,12 +287,7 @@ def error_msg_for_unequal_output( ) -> str: missing = set(expected_lines) - set(received_lines) unexpected = set(received_lines) - set(expected_lines) - error_msg = ( - f"Wrong output for '{self._test_file.base}.txt':\n" - "You can update the expected output automatically with: '" - f"python tests/test_functional.py {UPDATE_OPTION} -k " - f'"test_functional[{self._test_file.base}]"\'\n\n' - ) + error_msg = f"Wrong output for '{self._test_file.base}.txt':" sort_by_line_number = operator.attrgetter("lineno") if missing: error_msg += "\n- Missing lines:\n" @@ -302,6 +297,17 @@ def error_msg_for_unequal_output( error_msg += "\n- Unexpected lines:\n" for line in sorted(unexpected, key=sort_by_line_number): error_msg += f"{line}\n" + error_msg += ( + "\nYou can update the expected output automatically with:\n'" + f"python tests/test_functional.py {UPDATE_OPTION} -k " + f'"test_functional[{self._test_file.base}]"\'\n\n' + "Here's the update text in case you can't:\n" + ) + expected_csv = StringIO() + writer = csv.writer(expected_csv, dialect="test") + for line in sorted(received_lines, key=sort_by_line_number): + writer.writerow(line.to_csv()) + error_msg += expected_csv.getvalue() return error_msg def _check_output_text( From 1ded4d081480cccd573ddc6c592adccdc6723bb5 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Sat, 17 Dec 2022 15:03:05 +0100 Subject: [PATCH 9/9] Bump pylint to 2.15.9, update changelog (#7952) --- doc/whatsnew/2/2.15/index.rst | 34 ++++++++++++++++++++++ doc/whatsnew/fragments/3899.bugfix | 4 --- doc/whatsnew/fragments/5327.false_positive | 4 --- doc/whatsnew/fragments/7931.bugfix | 3 -- doc/whatsnew/fragments/7938.bugfix | 3 -- pylint/__pkginfo__.py | 2 +- tbump.toml | 2 +- 7 files changed, 36 insertions(+), 16 deletions(-) delete mode 100644 doc/whatsnew/fragments/3899.bugfix delete mode 100644 doc/whatsnew/fragments/5327.false_positive delete mode 100644 doc/whatsnew/fragments/7931.bugfix delete mode 100644 doc/whatsnew/fragments/7938.bugfix diff --git a/doc/whatsnew/2/2.15/index.rst b/doc/whatsnew/2/2.15/index.rst index ecbbf8f79a..e7099876ee 100644 --- a/doc/whatsnew/2/2.15/index.rst +++ b/doc/whatsnew/2/2.15/index.rst @@ -29,6 +29,40 @@ Marc Byrne became a maintainer, welcome to the team ! .. towncrier release notes start +What's new in Pylint 2.15.9? +---------------------------- +Release date: 2022-12-17 + + +False Positives Fixed +--------------------- + +- Fix false-positive for ``used-before-assignment`` in pattern matching + with a guard. + + Closes #5327 (`#5327 `_) + + + +Other Bug Fixes +--------------- + +- Pylint will no longer deadlock if a parallel job is killed but fail + immediately instead. + + Closes #3899 (`#3899 `_) + +- When pylint exit due to bad arguments being provided the exit code will now + be the expected ``32``. + + Refs #7931 (`#7931 `_) + +- Fixes a ``ModuleNotFound`` exception when running pylint on a Django project + with the ``pylint_django`` plugin enabled. + + Closes #7938 (`#7938 `_) + + What's new in Pylint 2.15.8? ---------------------------- Release date: 2022-12-05 diff --git a/doc/whatsnew/fragments/3899.bugfix b/doc/whatsnew/fragments/3899.bugfix deleted file mode 100644 index ed0ad38594..0000000000 --- a/doc/whatsnew/fragments/3899.bugfix +++ /dev/null @@ -1,4 +0,0 @@ -Pylint will no longer deadlock if a parallel job is killed but fail -immediately instead. - -Closes #3899 diff --git a/doc/whatsnew/fragments/5327.false_positive b/doc/whatsnew/fragments/5327.false_positive deleted file mode 100644 index 0cac649f80..0000000000 --- a/doc/whatsnew/fragments/5327.false_positive +++ /dev/null @@ -1,4 +0,0 @@ -Fix false-positive for ``used-before-assignment`` in pattern matching -with a guard. - -Closes #5327 diff --git a/doc/whatsnew/fragments/7931.bugfix b/doc/whatsnew/fragments/7931.bugfix deleted file mode 100644 index fe42346f43..0000000000 --- a/doc/whatsnew/fragments/7931.bugfix +++ /dev/null @@ -1,3 +0,0 @@ -When pylint exit due to bad arguments being provided the exit code will now be the expected ``32``. - -Refs #7931 diff --git a/doc/whatsnew/fragments/7938.bugfix b/doc/whatsnew/fragments/7938.bugfix deleted file mode 100644 index 1cffb9d1f4..0000000000 --- a/doc/whatsnew/fragments/7938.bugfix +++ /dev/null @@ -1,3 +0,0 @@ -Fixes a ``ModuleNotFound`` exception when running pylint on a Django project with the ``pylint_django`` plugin enabled. - -Closes #7938 diff --git a/pylint/__pkginfo__.py b/pylint/__pkginfo__.py index 41e2bda8cd..9bcdadb07d 100644 --- a/pylint/__pkginfo__.py +++ b/pylint/__pkginfo__.py @@ -9,7 +9,7 @@ from __future__ import annotations -__version__ = "2.15.8" +__version__ = "2.15.9" def get_numversion_from_version(v: str) -> tuple[int, int, int]: diff --git a/tbump.toml b/tbump.toml index e38f0e53f9..db284a4b06 100644 --- a/tbump.toml +++ b/tbump.toml @@ -1,7 +1,7 @@ github_url = "https://github.com/PyCQA/pylint" [version] -current = "2.15.8" +current = "2.15.9" regex = ''' ^(?P0|[1-9]\d*) \.