File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -334,13 +334,15 @@ def dep(info: ParamInfo = Depends()) -> ParamInfo:
334334 def target (my_test_param : ParamInfo = Depends (dep )) -> None :
335335 return None
336336
337- with DependencyGraph (target = target ).sync_ctx () as g :
337+ graph = DependencyGraph (target = target )
338+ with graph .sync_ctx () as g :
338339 kwargs = g .resolve_kwargs ()
339340
340341 info : ParamInfo = kwargs ["my_test_param" ]
341342 assert info .name == "my_test_param"
342343 assert info .definition
343344 assert info .definition .annotation == ParamInfo
345+ assert info .graph == graph
344346
345347
346348def test_param_info_no_dependant () -> None :
@@ -349,12 +351,14 @@ def test_param_info_no_dependant() -> None:
349351 def target (info : ParamInfo = Depends ()) -> None :
350352 return None
351353
352- with DependencyGraph (target = target ).sync_ctx () as g :
354+ graph = DependencyGraph (target = target )
355+ with graph .sync_ctx () as g :
353356 kwargs = g .resolve_kwargs ()
354357
355358 info : ParamInfo = kwargs ["info" ]
356359 assert info .name == ""
357360 assert info .definition is None
361+ assert info .graph == graph
358362
359363
360364def test_class_based_dependencies () -> None :
You can’t perform that action at this time.
0 commit comments