diff --git a/tests/functional/i/iterable_context.py b/tests/functional/i/iterable_context.py index f4488f0f6d..1ed134395a 100644 --- a/tests/functional/i/iterable_context.py +++ b/tests/functional/i/iterable_context.py @@ -198,3 +198,10 @@ def __getattr__(self, attr): # Regression test for https://github.com/pylint-dev/pylint/issues/6372 string_twos = "".join(str(*y) for _, *y in [[1, 2], [1, 2]]) + +# Regression test for https://github.com/pylint-dev/pylint/issues/9729 +class Model: + field: list[int] | None = None + + def method(self): + return [f + 1 for f in self.field] if self.field else None diff --git a/tests/functional/n/no/no_member_exception_group.py b/tests/functional/n/no/no_member_exception_group.py new file mode 100644 index 0000000000..ec8836692c --- /dev/null +++ b/tests/functional/n/no/no_member_exception_group.py @@ -0,0 +1,8 @@ +"""Indirect tests that ExceptionGroup is inferred.""" + +try: + ex_list = [ValueError("a"), ValueError("b"), Exception("c")] + raise ExceptionGroup("exceptions!", ex_list) +except* ValueError as exc: + assert exc.exceptions + assert exc.message diff --git a/tests/functional/n/no/no_member_exception_group.rc b/tests/functional/n/no/no_member_exception_group.rc new file mode 100644 index 0000000000..56e6770585 --- /dev/null +++ b/tests/functional/n/no/no_member_exception_group.rc @@ -0,0 +1,2 @@ +[testoptions] +min_pyver=3.11