python-dependency-injector icon indicating copy to clipboard operation
python-dependency-injector copied to clipboard

Fix `Closing` dependency resolution

Open jazzthief opened this issue 2 years ago • 1 comments
trafficstars

Fix issues found when using Closing to implement per-function scope for Resources.

  • Fixes #702: e.g. when a Factory depends on another Factory dependent on a Resource
  • Fixes a problem with not closing a Resource when it is the last element in the dependency graph
  • Incorporates #653 (thanks to @federinik)

jazzthief avatar May 22 '23 18:05 jazzthief

I have in mind a few potential test cases that could be added: when there are no resources in the dependency graph; and when there are several different resources. Apart from that, the change is ready.

jazzthief avatar May 24 '23 13:05 jazzthief