summaryrefslogtreecommitdiff
path: root/tests/data
diff options
context:
space:
mode:
authorTakahide Nojima <nozzy123nozzy@gmail.com>2021-10-23 16:42:44 +0900
committerTakahide Nojima <nozzy123nozzy@gmail.com>2021-10-26 15:01:23 +0000
commit30a6c5864d762b9500570a9d944f321b01584206 (patch)
treef9a71b3f80198ab606514c4ef541c7b34decb430 /tests/data
parent4e3acd8e4451ae39dbd5a6c8c5eba79300136d2f (diff)
downloadpylint-git-30a6c5864d762b9500570a9d944f321b01584206.tar.gz
Modify sources along with results of pr review.
- move "tests/prop_data/*" to "tests/data/." - make tests/data/property_pattern.py correctly executable. - remove class members not related to "property" from test/data/property_pattern.py. - modify tests of pyreverse to pass all tests.
Diffstat (limited to 'tests/data')
-rw-r--r--tests/data/property_pattern.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/data/property_pattern.py b/tests/data/property_pattern.py
new file mode 100644
index 000000000..e6bb3b9c9
--- /dev/null
+++ b/tests/data/property_pattern.py
@@ -0,0 +1,21 @@
+""" docstring for file property_pattern.py """
+class PropertyPatterns:
+ prop1 = property(lambda self: self._prop1*2, None, None, "property usage 1")
+
+ @property
+ def prop2(self):
+ """property usage 2"""
+ return self._prop2
+
+ @prop2.setter
+ def prop2(self, value):
+ self._prop2 = value * 2
+
+ def __init__(self):
+ self._prop1=1
+ self._prop2=2
+
+if __name__ == "__main__":
+ prop=PropertyPatterns()
+ assert(prop.prop1==2)
+ assert(prop.prop2==4)