summaryrefslogtreecommitdiff
path: root/tests/functional/u/undefined/undefined_variable_decorators.py
blob: 77c0b1229bb002fc1e0d18dffcc3bf054e78f19f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"""Tests for undefined-variable related to decorators"""
# pylint: disable=missing-function-docstring, missing-class-docstring, too-few-public-methods
# pylint: disable=unnecessary-comprehension

# Test that class attributes are in scope for listcomp in decorator.
# Regression reported in https://github.com/pylint-dev/pylint/issues/511

def dec(inp):
    def inner(func):
        print(inp)
        return func
    return inner


class Cls:

    DATA = "foo"

    @dec([x for x in DATA])
    def fun(self):
        pass