From 4838ea6aa89f95b41eae15a7b2a9e4e5329c51ea Mon Sep 17 00:00:00 2001 From: elina-israyelyan Date: Wed, 22 Oct 2025 23:26:10 +0400 Subject: [PATCH] remove redundant tests --- .../test_context_local_resource_py38.py | 34 ------------------- 1 file changed, 34 deletions(-) diff --git a/tests/unit/providers/resource/test_context_local_resource_py38.py b/tests/unit/providers/resource/test_context_local_resource_py38.py index 63f3c9b6..6fb85aed 100644 --- a/tests/unit/providers/resource/test_context_local_resource_py38.py +++ b/tests/unit/providers/resource/test_context_local_resource_py38.py @@ -41,8 +41,6 @@ def test_set_provides_returns_(): ], ) def test_set_provides_string_imports(str_name, cls): - print( providers.ContextLocalResource(str_name).provides) - print(cls) assert providers.ContextLocalResource(str_name).provides is cls @@ -220,38 +218,6 @@ def test_init_class(): assert TestResource.shutdown_counter == 2 -def test_init_class_generic_typing(): - # See issue: https://github.com/ets-labs/python-dependency-injector/issues/488 - class TestDependency: - ... - - class TestResource(resources.Resource[TestDependency]): - def init(self, *args: Any, **kwargs: Any) -> TestDependency: - return TestDependency() - - def shutdown(self, resource: TestDependency) -> None: ... - - assert issubclass(TestResource, resources.Resource) is True - - -def test_init_class_abc_init_definition_is_required(): - class TestResource(resources.Resource): - ... - - with raises(TypeError) as context: - TestResource() - - assert "Can't instantiate abstract class TestResource" in str(context.value) - assert "init" in str(context.value) - - -def test_init_class_abc_shutdown_definition_is_not_required(): - class TestResource(resources.Resource): - def init(self): - ... - - assert hasattr(TestResource(), "shutdown") is True - def test_init_not_callable(): provider = providers.ContextLocalResource(1)