summaryrefslogtreecommitdiff
path: root/tests/functional
diff options
context:
space:
mode:
authorMarc Mueller <30130371+cdce8p@users.noreply.github.com>2021-02-27 22:58:16 +0100
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2021-02-28 22:09:59 +0100
commit5ba60b8464cb4d7d79363cc3d185fa365dfb6c13 (patch)
tree16c1565f362a242725ee0197a8871b50b356f44a /tests/functional
parent9ee775377c01b1b8877785bbcc6a2eb12d945367 (diff)
downloadpylint-git-5ba60b8464cb4d7d79363cc3d185fa365dfb6c13.tar.gz
Fix test for astroid update
Diffstat (limited to 'tests/functional')
-rw-r--r--tests/functional/t/try_except_raise_crash.py11
-rw-r--r--tests/functional/t/try_except_raise_crash.rc2
-rw-r--r--tests/functional/t/try_except_raise_crash.txt3
3 files changed, 10 insertions, 6 deletions
diff --git a/tests/functional/t/try_except_raise_crash.py b/tests/functional/t/try_except_raise_crash.py
index 7a1f8d972..48a043493 100644
--- a/tests/functional/t/try_except_raise_crash.py
+++ b/tests/functional/t/try_except_raise_crash.py
@@ -1,15 +1,16 @@
# pylint: disable=missing-docstring,too-many-ancestors, broad-except
import collections.abc
-from typing import TYPE_CHECKING, Any, MutableMapping
+from typing import TYPE_CHECKING, Sized
if TYPE_CHECKING:
- BaseClass = MutableMapping[str, Any]
+ BaseClass = Sized
else:
- BaseClass = collections.abc.MutableMapping
+ BaseClass = collections.abc.Sized
class TestBaseException(BaseClass):
- pass
+ def __len__(self):
+ return 0
class TestException(TestBaseException):
@@ -19,7 +20,7 @@ class TestException(TestBaseException):
def test():
try:
1 / 0
- except TestException: # [try-except-raise]
+ except TestException: # [catching-non-exception,try-except-raise]
raise
except Exception:
pass
diff --git a/tests/functional/t/try_except_raise_crash.rc b/tests/functional/t/try_except_raise_crash.rc
new file mode 100644
index 000000000..a17bb22da
--- /dev/null
+++ b/tests/functional/t/try_except_raise_crash.rc
@@ -0,0 +1,2 @@
+[testoptions]
+min_pyver=3.7
diff --git a/tests/functional/t/try_except_raise_crash.txt b/tests/functional/t/try_except_raise_crash.txt
index b5d389d58..0fab918b9 100644
--- a/tests/functional/t/try_except_raise_crash.txt
+++ b/tests/functional/t/try_except_raise_crash.txt
@@ -1 +1,2 @@
-try-except-raise:22:4:test:The except handler raises immediately
+catching-non-exception:23:11:test:"Catching an exception which doesn't inherit from Exception: TestException"
+try-except-raise:23:4:test:The except handler raises immediately