Skip to content

Commit c013154

Browse files
committed
Use Singleton provider; clean up formatting
1 parent 6494256 commit c013154

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

tests/unit/samples/wiringstringids/resourceclosing.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class Container(containers.DeclarativeContainer):
6464

6565
class ContainerSingleton(containers.DeclarativeContainer):
6666

67-
singleton = providers.Resource(Singleton)
67+
singleton = providers.Singleton(Singleton)
6868
service = providers.Resource(
6969
init_service_with_singleton,
7070
singleton
@@ -83,12 +83,16 @@ def test_function(service: Service = Closing[Provide["service"]]):
8383

8484

8585
@inject
86-
def test_function_dependency(factory: FactoryService = Closing[Provide["factory_service"]]):
86+
def test_function_dependency(
87+
factory: FactoryService = Closing[Provide["factory_service"]]
88+
):
8789
return factory
8890

8991

9092
@inject
91-
def test_function_dependency_kwargs(factory: FactoryService = Closing[Provide["factory_service_kwargs"]]):
93+
def test_function_dependency_kwargs(
94+
factory: FactoryService = Closing[Provide["factory_service_kwargs"]]
95+
):
9296
return factory
9397

9498

tests/unit/wiring/string_ids/test_main_py36.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ def subcontainer():
3333
container.unwire()
3434

3535

36-
@fixture(params=[resourceclosing.Container, resourceclosing.ContainerSingleton])
36+
@fixture(params=[
37+
resourceclosing.Container,
38+
resourceclosing.ContainerSingleton,
39+
])
3740
def resourceclosing_container(request):
3841
container = request.param()
3942
container.wire(modules=[resourceclosing])

0 commit comments

Comments
 (0)