Skip to content

Commit

Permalink
Add regression test for issue #5382 (#5550)
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielNoord authored Dec 17, 2021
1 parent 889a1d0 commit fd18848
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests/functional/r/regression_02/regression_node_statement_two.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"""Test to see we don't crash on this code in pandas.
See: https://github.com/pandas-dev/pandas/blob/master/pandas/core/indexes/period.py
Reported in https://github.com/PyCQA/pylint/issues/5382
"""
# pylint: disable=missing-function-docstring, missing-class-docstring, no-self-use, unused-argument
# pylint: disable=too-few-public-methods, no-method-argument, invalid-name


def my_decorator(*params):
def decorator(decorated):
return decorated

return decorator


class ClassWithProperty:
def f():
return "string"

f.__name__ = "name"
f.__doc__ = "docstring"

hour = property(f)


class ClassWithDecorator:
@my_decorator(ClassWithProperty.hour.fget)
def my_property(self) -> str:
return "a string"

0 comments on commit fd18848

Please sign in to comment.