Python: API-graphs: test class decorators and subclass

A class decorator could change the class definition in any way.

In this specific case, it would be better if we allowed the subclass to
be found with API graphs still.

inspired by
c2250cfb80/tests/auth_tests/test_views.py (L40-L46)
This commit is contained in:
Rasmus Wriedt Larsen
2022-06-15 16:16:34 +02:00
parent b2c8e0fe8d
commit 5f32f898d5

View File

@@ -17,3 +17,18 @@ def internal():
pass pass
int_instance = IntMyView() #$ use=moduleImport("pflask").getMember("views").getMember("View").getASubclass().getReturn() int_instance = IntMyView() #$ use=moduleImport("pflask").getMember("views").getMember("View").getASubclass().getReturn()
# ------------------------------------------------------------------------------
# Class decorator
# ------------------------------------------------------------------------------
def my_class_decorator(cls):
print("dummy decorator")
return cls
@my_class_decorator
class MyViewWithDecorator(View): #$ use=moduleImport("flask").getMember("views").getMember("View").getASubclass()
pass
class SubclassFromDecorated(MyViewWithDecorator): #$ MISSING: use=moduleImport("flask").getMember("views").getMember("View").getASubclass().getASubclass()
pass