From 85be14143035ca8954aa01e39f03a4bee0ba12a0 Mon Sep 17 00:00:00 2001 From: Federico Tomasi Date: Wed, 21 Dec 2022 19:07:04 +0100 Subject: [PATCH] Fix tests --- tests/unit/wiring/string_ids/test_main_py36.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/tests/unit/wiring/string_ids/test_main_py36.py b/tests/unit/wiring/string_ids/test_main_py36.py index 9aef1f45..826ef80c 100644 --- a/tests/unit/wiring/string_ids/test_main_py36.py +++ b/tests/unit/wiring/string_ids/test_main_py36.py @@ -303,12 +303,20 @@ def test_closing_dependency_resource(): assert result_2.service.init_counter == 2 assert result_2.service.shutdown_counter == 2 - result_3 = resourceclosing.test_function_dependency_kwargs() - assert isinstance(result_3, resourceclosing.FactoryService) - assert result_3.service.init_counter == 3 - assert result_3.service.shutdown_counter == 3 - assert result_1 is not result_2 and result_2 is not result_3 +@mark.usefixtures("resourceclosing_container") +def test_closing_dependency_resource_kwargs(): + resourceclosing.Service.reset_counter() + + result_1 = resourceclosing.test_function_dependency_kwargs() + assert isinstance(result_1, resourceclosing.FactoryService) + assert result_1.service.init_counter == 1 + assert result_1.service.shutdown_counter == 1 + + result_2 = resourceclosing.test_function_dependency_kwargs() + assert isinstance(result_2, resourceclosing.FactoryService) + assert result_2.service.init_counter == 2 + assert result_2.service.shutdown_counter == 2 @mark.usefixtures("resourceclosing_container")