mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-22 09:36:48 +03:00
Remove undocumented positional parameter of DependenciesContainer provider
This commit is contained in:
parent
feab6b6814
commit
2c43a1c426
|
@ -11,6 +11,7 @@ Development version
|
|||
-------------------
|
||||
- Add ``Configuration.from_ini()`` method to load configuration from ini file.
|
||||
- Add ``Configuration.from_dict()`` method to load configuration from dictionary.
|
||||
- Remove undocumented positional parameter of ``DependenciesContainer`` provider.
|
||||
|
||||
3.17.1
|
||||
------
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -507,14 +507,10 @@ cdef class DependenciesContainer(Object):
|
|||
use_case.execute()
|
||||
"""
|
||||
|
||||
def __init__(self, provides=None, **dependencies):
|
||||
def __init__(self, **dependencies):
|
||||
"""Initializer."""
|
||||
self.__providers = dependencies
|
||||
|
||||
if provides:
|
||||
self._override_providers(container=provides)
|
||||
|
||||
super(DependenciesContainer, self).__init__(provides)
|
||||
super(DependenciesContainer, self).__init__(None)
|
||||
|
||||
def __deepcopy__(self, memo):
|
||||
"""Create and return full copy of provider."""
|
||||
|
@ -2160,7 +2156,6 @@ cdef class Container(Provider):
|
|||
deepcopy(self.container, memo),
|
||||
**deepcopy(self.overriding_providers, memo),
|
||||
)
|
||||
# self._copy_overridings(copied, memo)
|
||||
|
||||
return copied
|
||||
|
||||
|
|
|
@ -367,11 +367,3 @@ class DependenciesContainerTests(unittest.TestCase):
|
|||
|
||||
self.assertFalse(dependency.overridden)
|
||||
self.assertFalse(dependency.overridden)
|
||||
|
||||
def test_init_with_container_and_providers(self):
|
||||
provider = providers.DependenciesContainer(
|
||||
self.container, dependency=providers.Dependency())
|
||||
dependency = provider.dependency
|
||||
|
||||
self.assertTrue(dependency.overridden)
|
||||
self.assertIs(dependency.last_overriding, self.container.dependency)
|
||||
|
|
Loading…
Reference in New Issue
Block a user