diff --git a/dependency_injector/catalogs/dynamic.py b/dependency_injector/catalogs/dynamic.py index 97340320..607b8124 100644 --- a/dependency_injector/catalogs/dynamic.py +++ b/dependency_injector/catalogs/dynamic.py @@ -1,7 +1,5 @@ """Dependency injector dynamic catalog module.""" -import copy - import six from dependency_injector.catalogs.bundle import CatalogBundle @@ -287,25 +285,6 @@ class DynamicCatalog(object): del self.providers[name] del self.provider_names[provider] - def copy(self): - """Copy catalog instance and return it. - - :rtype: py:class:`DynamicCatalog` - :return: Copied catalog. - """ - return copy.copy(self) - - def deepcopy(self, memo=None): - """Copy catalog instance and it's providers and return it. - - :param memo: Memorized instances - :type memo: dict[int, object] - - :rtype: py:class:`DynamicCatalog` - :return: Copied catalog. - """ - return copy.deepcopy(self, memo) - def __getattr__(self, name): """Return provider with specified name or raise en error. diff --git a/tests/catalogs/test_dynamic.py b/tests/catalogs/test_dynamic.py index de8ed1f2..7d74e222 100644 --- a/tests/catalogs/test_dynamic.py +++ b/tests/catalogs/test_dynamic.py @@ -212,22 +212,6 @@ class DynamicCatalogTests(unittest.TestCase): self.assertTrue(len(self.catalog.filter(providers.Provider)) == 2) self.assertTrue(len(self.catalog.filter(providers.Value)) == 0) - def test_copy(self): - """Test copying of catalog.""" - catalog_copy = self.catalog.copy() - - self.assertIsNot(self.catalog, catalog_copy) - self.assertIs(self.catalog.p1, catalog_copy.p1) - self.assertIs(self.catalog.p2, catalog_copy.p2) - - def test_deepcopy(self): - """Test copying of catalog.""" - catalog_copy = self.catalog.deepcopy() - - self.assertIsNot(self.catalog, catalog_copy) - self.assertIsNot(self.catalog.p1, catalog_copy.p1) - self.assertIsNot(self.catalog.p2, catalog_copy.p2) - def test_repr(self): """Test catalog representation.""" self.assertIn('TestCatalog', repr(self.catalog))