summaryrefslogtreecommitdiff
path: root/pylint/test/functional/with_using_generator.py
blob: 187bdcfeaa9aa43050d30fa33fed87daa3c70418 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
""" Testing with statements that use generators. This should not crash. """
# pylint: disable=useless-object-inheritance

class Base(object):
    """ Base class. """
    val = 0

    def gen(self):
        """ A generator. """
        yield self.val

    def fun(self):
        """ With statement using a generator. """
        with self.gen():  # [not-context-manager]
            pass