python-dependency-injector
python-dependency-injector copied to clipboard
Fix `Closing` dependency resolution
trafficstars
Fix issues found when using Closing to implement per-function scope for Resources.
- Fixes #702: e.g. when a
Factorydepends on anotherFactorydependent on aResource - Fixes a problem with not closing a
Resourcewhen it is the last element in the dependency graph - Incorporates #653 (thanks to @federinik)
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.