|
|
|
@ -65,6 +65,15 @@ wrapped_class_instance_dep = noop_wrap(class_instance_dep) |
|
|
|
wrapped_class_instance_dep_async_wrapper = noop_wrap_async(class_instance_dep) |
|
|
|
|
|
|
|
|
|
|
|
class ClassInstanceGenDep: |
|
|
|
def __call__(self): |
|
|
|
yield True |
|
|
|
|
|
|
|
|
|
|
|
class_instance_gen_dep = ClassInstanceGenDep() |
|
|
|
wrapped_class_instance_gen_dep = noop_wrap(class_instance_gen_dep) |
|
|
|
|
|
|
|
|
|
|
|
class ClassInstanceWrappedDep: |
|
|
|
@noop_wrap |
|
|
|
def __call__(self): |
|
|
|
@ -122,6 +131,15 @@ wrapped_class_instance_async_dep_async_wrapper = noop_wrap_async( |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
class ClassInstanceAsyncGenDep: |
|
|
|
async def __call__(self): |
|
|
|
yield True |
|
|
|
|
|
|
|
|
|
|
|
class_instance_async_gen_dep = ClassInstanceAsyncGenDep() |
|
|
|
wrapped_class_instance_async_gen_dep = noop_wrap(class_instance_async_gen_dep) |
|
|
|
|
|
|
|
|
|
|
|
class ClassInstanceAsyncWrappedDep: |
|
|
|
@noop_wrap |
|
|
|
async def __call__(self): |
|
|
|
@ -218,6 +236,20 @@ async def get_wrapped_class_instance_async_dependency( |
|
|
|
return value |
|
|
|
|
|
|
|
|
|
|
|
@app.get("/wrapped-class-instance-gen-dependency/") |
|
|
|
async def get_wrapped_class_instance_gen_dependency( |
|
|
|
value: bool = Depends(wrapped_class_instance_gen_dep), |
|
|
|
): |
|
|
|
return value |
|
|
|
|
|
|
|
|
|
|
|
@app.get("/wrapped-class-instance-async-gen-dependency/") |
|
|
|
async def get_wrapped_class_instance_async_gen_dependency( |
|
|
|
value: bool = Depends(wrapped_class_instance_async_gen_dep), |
|
|
|
): |
|
|
|
return value |
|
|
|
|
|
|
|
|
|
|
|
@app.get("/class-instance-wrapped-dependency/") |
|
|
|
async def get_class_instance_wrapped_dependency( |
|
|
|
value: bool = Depends(class_instance_wrapped_dep), |
|
|
|
@ -387,6 +419,8 @@ client = TestClient(app) |
|
|
|
"/async-wrapped-gen-dependency/", |
|
|
|
"/wrapped-class-instance-dependency/", |
|
|
|
"/wrapped-class-instance-async-dependency/", |
|
|
|
"/wrapped-class-instance-gen-dependency/", |
|
|
|
"/wrapped-class-instance-async-gen-dependency/", |
|
|
|
"/class-instance-wrapped-dependency/", |
|
|
|
"/class-instance-wrapped-async-dependency/", |
|
|
|
"/class-instance-async-wrapped-dependency/", |
|
|
|
|