Remove undocumented positional parameter of DependenciesContainer provider

This commit is contained in:
Roman Mogylatov 2020-06-24 14:39:07 -04:00
parent feab6b6814
commit 2c43a1c426
4 changed files with 2365 additions and 2452 deletions

View File

@ -11,6 +11,7 @@ Development version
------------------- -------------------
- Add ``Configuration.from_ini()`` method to load configuration from ini file. - Add ``Configuration.from_ini()`` method to load configuration from ini file.
- Add ``Configuration.from_dict()`` method to load configuration from dictionary. - Add ``Configuration.from_dict()`` method to load configuration from dictionary.
- Remove undocumented positional parameter of ``DependenciesContainer`` provider.
3.17.1 3.17.1
------ ------

File diff suppressed because it is too large Load Diff

View File

@ -507,14 +507,10 @@ cdef class DependenciesContainer(Object):
use_case.execute() use_case.execute()
""" """
def __init__(self, provides=None, **dependencies): def __init__(self, **dependencies):
"""Initializer.""" """Initializer."""
self.__providers = dependencies self.__providers = dependencies
super(DependenciesContainer, self).__init__(None)
if provides:
self._override_providers(container=provides)
super(DependenciesContainer, self).__init__(provides)
def __deepcopy__(self, memo): def __deepcopy__(self, memo):
"""Create and return full copy of provider.""" """Create and return full copy of provider."""
@ -2160,7 +2156,6 @@ cdef class Container(Provider):
deepcopy(self.container, memo), deepcopy(self.container, memo),
**deepcopy(self.overriding_providers, memo), **deepcopy(self.overriding_providers, memo),
) )
# self._copy_overridings(copied, memo)
return copied return copied

View File

@ -367,11 +367,3 @@ class DependenciesContainerTests(unittest.TestCase):
self.assertFalse(dependency.overridden) self.assertFalse(dependency.overridden)
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)