Skip to content

Commit

Permalink
Add a regression test for generator raised StopIteration pylint-dev#4723
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Sassoulas committed Jul 19, 2021
1 parent f437752 commit caf2bec
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/functional/r/regression/regression_4723.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
"""Latest version of astroid (2.6.3) causes RuntimeError:
generator raised StopIteration #4723"""
# pylint: disable=locally-disabled

import contextlib


class A:
@contextlib.contextmanager
def get(self):
yield self


class B(A):
def play():
pass


def func():
with B().get() as b:
b.play()

0 comments on commit caf2bec

Please sign in to comment.