summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniƫl van Noord <13665637+DanielNoord@users.noreply.github.com>2021-12-17 22:38:28 +0100
committerGitHub <noreply@github.com>2021-12-17 22:38:28 +0100
commitfd18848e4491fe67b79537a79725655c81fe26ef (patch)
treecc52a2fa4ad7b484f0c7269a6ce444b006bca552
parent889a1d0cc5f9f2074159720e72cb879c45faa810 (diff)
downloadpylint-git-fd18848e4491fe67b79537a79725655c81fe26ef.tar.gz
Add regression test for issue #5382 (#5550)
-rw-r--r--tests/functional/r/regression_02/regression_node_statement_two.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/functional/r/regression_02/regression_node_statement_two.py b/tests/functional/r/regression_02/regression_node_statement_two.py
new file mode 100644
index 000000000..e2db94791
--- /dev/null
+++ b/tests/functional/r/regression_02/regression_node_statement_two.py
@@ -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"