From b59dfeabb7d1a8ab1fe605f955b8bf6bccb9af60 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 7 Jun 2023 11:00:57 +0000 Subject: [PATCH] Add regression test for #8554 (#8682) (#8751) Co-authored-by: Pierre Sassoulas (cherry picked from commit 2acca90eab93569f9482b1c7595c30207afcbe7c) Co-authored-by: Jacob Walls --- doc/whatsnew/fragments/8554.bugfix | 3 +++ pyproject.toml | 2 +- requirements_test_min.txt | 2 +- tests/functional/i/invalid/invalid_unary_operand_type.py | 7 +++++++ 4 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 doc/whatsnew/fragments/8554.bugfix diff --git a/doc/whatsnew/fragments/8554.bugfix b/doc/whatsnew/fragments/8554.bugfix new file mode 100644 index 0000000000..5bb60ae157 --- /dev/null +++ b/doc/whatsnew/fragments/8554.bugfix @@ -0,0 +1,3 @@ +Fixed crash when a call to ``super()`` was placed after an operator (e.g. ``not``). + +Closes #8554 diff --git a/pyproject.toml b/pyproject.toml index bd542646b3..6e8fb90ebe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,7 @@ dependencies = [ # Also upgrade requirements_test_min.txt. # Pinned to dev of second minor update to allow editable installs and fix primer issues, # see https://github.com/pylint-dev/astroid/issues/1341 - "astroid>=2.15.4,<=2.17.0-dev0", + "astroid>=2.15.5,<=2.17.0-dev0", "isort>=4.2.5,<6", "mccabe>=0.6,<0.8", "tomli>=1.1.0;python_version<'3.11'", diff --git a/requirements_test_min.txt b/requirements_test_min.txt index 499d287f64..9d44ad110c 100644 --- a/requirements_test_min.txt +++ b/requirements_test_min.txt @@ -1,6 +1,6 @@ -e .[testutils,spelling] # astroid dependency is also defined in pyproject.toml -astroid==2.15.4 # Pinned to a specific version for tests +astroid==2.15.5 # Pinned to a specific version for tests typing-extensions~=4.5 py~=1.11.0 pytest~=7.2 diff --git a/tests/functional/i/invalid/invalid_unary_operand_type.py b/tests/functional/i/invalid/invalid_unary_operand_type.py index 5881f89ec9..3f8c824851 100644 --- a/tests/functional/i/invalid/invalid_unary_operand_type.py +++ b/tests/functional/i/invalid/invalid_unary_operand_type.py @@ -49,3 +49,10 @@ class A: invert_instance = ~A() # [invalid-unary-operand-type] invert_module = ~collections # [invalid-unary-operand-type] invert_float = ~2.0 # [invalid-unary-operand-type] + + +class NoArgumentSuper: + def __init__(self): + """https://github.com/pylint-dev/pylint/issues/8554""" + if not isinstance(super(), float): + pass