From 066a1846634a3693abb41ce96da4dcdceef47ac0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Noord?= <13665637+DanielNoord@users.noreply.github.com> Date: Thu, 7 Oct 2021 15:05:45 +0200 Subject: [PATCH] Add test for crash on Compare node inference (#5057) Closes #5048 Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com> --- ChangeLog | 4 ++++ tests/functional/r/regression/regression_5048.py | 9 +++++++++ tests/test_functional.py | 3 ++- 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 tests/functional/r/regression/regression_5048.py diff --git a/ChangeLog b/ChangeLog index 00eb650ec6..c63a18a848 100644 --- a/ChangeLog +++ b/ChangeLog @@ -80,6 +80,10 @@ Release date: TBA Closes #5030 Closes #5036 +* Fix regression on Compare node inference + + Closes #5048 + What's New in Pylint 2.11.1? ============================ diff --git a/tests/functional/r/regression/regression_5048.py b/tests/functional/r/regression/regression_5048.py new file mode 100644 index 0000000000..5656759af5 --- /dev/null +++ b/tests/functional/r/regression/regression_5048.py @@ -0,0 +1,9 @@ +"""Crash regression in astroid on Compare node inference +Fixed in https://github.com/PyCQA/astroid/pull/1185""" +# pylint: disable=missing-docstring + + +# Reported at https://github.com/PyCQA/pylint/issues/5048 +def func(parameter): + if tuple() + (parameter[1],) in set(): + raise Exception() diff --git a/tests/test_functional.py b/tests/test_functional.py index 513823a057..9b1f8ea7ac 100644 --- a/tests/test_functional.py +++ b/tests/test_functional.py @@ -45,7 +45,8 @@ # 'Wet finger' number of files that are reasonable to display by an IDE # 'Wet finger' as in 'in my settings there are precisely this many'. -REASONABLY_DISPLAYABLE_VERTICALLY = 48 +# TODO revert back to 48 after reorganizing r/regression # pylint: disable=fixme +REASONABLY_DISPLAYABLE_VERTICALLY = 60 class LintModuleOutputUpdate(testutils.LintModuleTest):