diff options
author | Marc Mueller <30130371+cdce8p@users.noreply.github.com> | 2021-02-27 22:58:16 +0100 |
---|---|---|
committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-02-28 22:09:59 +0100 |
commit | 5ba60b8464cb4d7d79363cc3d185fa365dfb6c13 (patch) | |
tree | 16c1565f362a242725ee0197a8871b50b356f44a /tests/functional | |
parent | 9ee775377c01b1b8877785bbcc6a2eb12d945367 (diff) | |
download | pylint-git-5ba60b8464cb4d7d79363cc3d185fa365dfb6c13.tar.gz |
Fix test for astroid update
Diffstat (limited to 'tests/functional')
-rw-r--r-- | tests/functional/t/try_except_raise_crash.py | 11 | ||||
-rw-r--r-- | tests/functional/t/try_except_raise_crash.rc | 2 | ||||
-rw-r--r-- | tests/functional/t/try_except_raise_crash.txt | 3 |
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 |