Merge branch 'release/4.8.3' into master

This commit is contained in:
Roman Mogylatov 2021-01-15 06:44:54 -05:00
commit 3e207a4f21
5 changed files with 3183 additions and 3132 deletions

View File

@ -7,6 +7,12 @@ that were made in every particular version.
From version 0.7.6 *Dependency Injector* framework strictly
follows `Semantic versioning`_
4.8.3
-----
- Fix a bug in the ``Configuration`` provider to correctly handle overriding by ``None``.
See issue `#358 <https://github.com/ets-labs/python-dependency-injector/issues/358>`_.
Many thanks to `Stefano Frazzetto <https://github.com/StefanoFrazzetto>`_ for reporting the issue.
4.8.2
-----
- Fix ``Container`` provider to apply context overridings on root container initialization.

View File

@ -1,6 +1,6 @@
"""Top-level package."""
__version__ = '4.8.2'
__version__ = '4.8.3'
"""Version number.
:type: str

File diff suppressed because it is too large Load Diff

View File

@ -1507,6 +1507,8 @@ cdef class Configuration(Object):
:return: Overriding context.
:rtype: :py:class:`OverridingContext`
"""
if provider is None:
provider = {}
context = super().override(provider)
self.reset_cache()
return context

View File

@ -185,6 +185,13 @@ class ConfigTests(unittest.TestCase):
with self.assertRaises(AttributeError):
a.__name__
def test_missing_key(self):
# See: https://github.com/ets-labs/python-dependency-injector/issues/358
self.config.override(None)
value = self.config.key()
self.assertIsNone(value)
def test_deepcopy(self):
provider = providers.Configuration('config')
provider_copy = providers.deepcopy(provider)