summaryrefslogtreecommitdiff
path: root/tests/functional/u/undefined/undefined_variable_decorators.py
blob: 3597372893594fa7f5087d38f9a111244dd61a52 (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/PyCQA/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