33import pytest
44
55from injection import (
6+ adefine_scope ,
67 afind_instance ,
7- async_scope ,
8+ define_scope ,
89 find_instance ,
910 injectable ,
1011 scoped ,
11- sync_scope ,
1212)
1313from injection .exceptions import ScopeError , ScopeUndefinedError
1414
@@ -18,7 +18,7 @@ def test_scoped_with_success(self):
1818 @scoped ("test" )
1919 class SomeInjectable : ...
2020
21- with sync_scope ("test" ):
21+ with define_scope ("test" ):
2222 instance_1 = find_instance (SomeInjectable )
2323 instance_2 = find_instance (SomeInjectable )
2424
@@ -30,7 +30,7 @@ class A: ...
3030 @scoped ("test" , on = A )
3131 class B (A ): ...
3232
33- with sync_scope ("test" ):
33+ with define_scope ("test" ):
3434 a = find_instance (A )
3535 b = find_instance (B )
3636
@@ -44,7 +44,7 @@ class B(A): ...
4444 @scoped ("test" , on = (A , B ))
4545 class C (B ): ...
4646
47- with sync_scope ("test" ):
47+ with define_scope ("test" ):
4848 a = find_instance (A )
4949 b = find_instance (B )
5050 c = find_instance (C )
@@ -76,7 +76,7 @@ class A: ...
7676 @scoped ("test" , on = A , mode = "override" )
7777 class B (A ): ...
7878
79- with sync_scope ("test" ):
79+ with define_scope ("test" ):
8080 a = find_instance (A )
8181
8282 assert isinstance (a , B )
@@ -91,7 +91,7 @@ class B(A): ...
9191 @scoped ("test" , on = A , mode = "override" )
9292 class C (B ): ...
9393
94- with sync_scope ("test" ):
94+ with define_scope ("test" ):
9595 a = find_instance (A )
9696
9797 assert isinstance (a , C )
@@ -103,7 +103,7 @@ class SomeInjectable: ...
103103 def some_injectable_recipe () -> SomeInjectable :
104104 return SomeInjectable ()
105105
106- with sync_scope ("test" ):
106+ with define_scope ("test" ):
107107 instance_1 = find_instance (SomeInjectable )
108108 instance_2 = find_instance (SomeInjectable )
109109
@@ -116,7 +116,7 @@ class SomeInjectable: ...
116116 async def some_injectable_recipe () -> SomeInjectable :
117117 return SomeInjectable ()
118118
119- with sync_scope ("test" ):
119+ with define_scope ("test" ):
120120 instance_1 = await afind_instance (SomeInjectable )
121121 instance_2 = await afind_instance (SomeInjectable )
122122
@@ -129,7 +129,7 @@ class SomeInjectable: ...
129129 def some_injectable_recipe () -> Iterator [SomeInjectable ]:
130130 yield SomeInjectable ()
131131
132- with sync_scope ("test" ):
132+ with define_scope ("test" ):
133133 instance_1 = find_instance (SomeInjectable )
134134 instance_2 = find_instance (SomeInjectable )
135135
@@ -142,7 +142,7 @@ class SomeInjectable: ...
142142 def some_injectable_recipe () -> Iterator [SomeInjectable ]:
143143 yield SomeInjectable ()
144144
145- async with async_scope ("test" ):
145+ async with adefine_scope ("test" ):
146146 instance_1 = find_instance (SomeInjectable )
147147 instance_2 = find_instance (SomeInjectable )
148148
@@ -157,7 +157,7 @@ class SomeInjectable: ...
157157 async def some_injectable_recipe () -> AsyncIterator [SomeInjectable ]:
158158 yield SomeInjectable () # pragma: no cover
159159
160- with sync_scope ("test" ):
160+ with define_scope ("test" ):
161161 with pytest .raises (ScopeError ):
162162 await afind_instance (SomeInjectable )
163163
@@ -168,7 +168,7 @@ class SomeInjectable: ...
168168 async def some_injectable_recipe () -> AsyncIterator [SomeInjectable ]:
169169 yield SomeInjectable ()
170170
171- async with async_scope ("test" ):
171+ async with adefine_scope ("test" ):
172172 instance_1 = await afind_instance (SomeInjectable )
173173 instance_2 = await afind_instance (SomeInjectable )
174174
0 commit comments