Python: Add test for @property problem

This commit is contained in:
Rasmus Wriedt Larsen
2022-10-20 21:11:01 +02:00
parent b33f02f9dc
commit cba93ded77
2 changed files with 14 additions and 3 deletions

View File

@@ -1,8 +1,8 @@
failures
debug_callableNotUnique
| code/class_properties.py:7:5:7:18 | Function arg | Qualified function name 'Prop.arg' is not unique within its file. Please fix. |
| code/class_properties.py:12:5:12:25 | Function arg | Qualified function name 'Prop.arg' is not unique within its file. Please fix. |
| code/class_properties.py:17:5:17:18 | Function arg | Qualified function name 'Prop.arg' is not unique within its file. Please fix. |
| code/class_properties.py:10:5:10:18 | Function arg | Qualified function name 'Prop.arg' is not unique within its file. Please fix. |
| code/class_properties.py:15:5:15:25 | Function arg | Qualified function name 'Prop.arg' is not unique within its file. Please fix. |
| code/class_properties.py:20:5:20:18 | Function arg | Qualified function name 'Prop.arg' is not unique within its file. Please fix. |
pointsTo_found_typeTracker_notFound
| code/class_attr_assign.py:10:9:10:27 | ControlFlowNode for Attribute() | my_func |
| code/class_attr_assign.py:11:9:11:25 | ControlFlowNode for Attribute() | my_func |

View File

@@ -1,3 +1,6 @@
def func():
print("func")
class Prop(object):
def __init__(self, arg):
self._arg = arg
@@ -32,6 +35,11 @@ class Prop(object):
arg2 = property(_arg2_getter, _arg2_setter, _arg2_deleter)
@property
def func_prop(self):
print("Prop.func_prop getter")
return func
prop = Prop(42) # $ tt=Prop.__init__
prop.arg
@@ -41,3 +49,6 @@ del prop.arg
prop.arg2
prop.arg2 = 43
del prop.arg2
f = prop.func_prop
f() # $ SPURIOUS: tt=Prop.func_prop MISSING: tt=func