@@ -68,41 +68,41 @@ async def test_actor_init_instance_manual() -> None:
6868 """Test that Actor instance can be properly initialized and cleaned up manually."""
6969 actor = Actor ()
7070 await actor .init ()
71- assert actor ._is_initialized is True
71+ assert actor ._active is True
7272 await actor .exit ()
73- assert actor ._is_initialized is False
73+ assert actor ._active is False
7474
7575
7676async def test_actor_init_instance_async_with () -> None :
7777 """Test that Actor instance can be properly initialized and cleaned up using async context manager."""
7878 actor = Actor ()
7979 async with actor :
80- assert actor ._is_initialized is True
80+ assert actor ._active is True
8181
82- assert actor ._is_initialized is False
82+ assert actor ._active is False
8383
8484
8585async def test_actor_init_class_manual () -> None :
8686 """Test that Actor class can be properly initialized and cleaned up manually."""
8787 await Actor .init ()
88- assert Actor ._is_initialized is True
88+ assert Actor ._active is True
8989 await Actor .exit ()
90- assert not Actor ._is_initialized
90+ assert not Actor ._active
9191
9292
9393async def test_actor_init_class_async_with () -> None :
9494 """Test that Actor class can be properly initialized and cleaned up using async context manager."""
9595 async with Actor :
96- assert Actor ._is_initialized is True
96+ assert Actor ._active is True
9797
98- assert not Actor ._is_initialized
98+ assert not Actor ._active
9999
100100
101101async def test_fail_properly_deinitializes_actor (actor : _ActorType ) -> None :
102102 """Test that fail() method properly deinitializes the Actor."""
103- assert actor ._is_initialized
103+ assert actor ._active
104104 await actor .fail ()
105- assert actor ._is_initialized is False
105+ assert actor ._active is False
106106
107107
108108async def test_actor_handles_exceptions_and_cleans_up_properly () -> None :
@@ -111,16 +111,16 @@ async def test_actor_handles_exceptions_and_cleans_up_properly() -> None:
111111
112112 with contextlib .suppress (Exception ):
113113 async with Actor () as actor :
114- assert actor ._is_initialized
114+ assert actor ._active
115115 raise Exception ('Failed' ) # noqa: TRY002
116116
117117 assert actor is not None
118- assert actor ._is_initialized is False
118+ assert actor ._active is False
119119
120120
121121async def test_double_init_raises_runtime_error (actor : _ActorType ) -> None :
122122 """Test that attempting to initialize an already initialized Actor raises RuntimeError."""
123- assert actor ._is_initialized
123+ assert actor ._active
124124 with pytest .raises (RuntimeError ):
125125 await actor .init ()
126126
@@ -196,7 +196,7 @@ def on_event(event_type: Event) -> Callable:
196196
197197 actor = Actor ()
198198 async with actor :
199- assert actor ._is_initialized
199+ assert actor ._active
200200 actor .on (Event .PERSIST_STATE , on_event (Event .PERSIST_STATE ))
201201 actor .on (Event .SYSTEM_INFO , on_event (Event .SYSTEM_INFO ))
202202 await asyncio .sleep (1 )
@@ -249,12 +249,12 @@ async def test_actor_sequential_contexts(*, first_with_call: bool, second_with_c
249249 mock = AsyncMock ()
250250 async with Actor (exit_process = False ) if first_with_call else Actor as actor :
251251 await mock ()
252- assert actor ._is_initialized is True
252+ assert actor ._active is True
253253
254254 # After exiting the context, new Actor instance can be created without conflicts.
255255 async with Actor () if second_with_call else Actor as actor :
256256 await mock ()
257- assert actor ._is_initialized is True
257+ assert actor ._active is True
258258
259259 # The mock should have been called twice, once in each context.
260260 assert mock .call_count == 2
0 commit comments