@@ -80,7 +80,7 @@ def task_func():
8080 task_obj .start ()
8181 task_obj .join ()
8282 assert task_obj ._return_value == "Return value"
83- assert task_obj ._status == "success "
83+ assert task_obj ._status == "completed "
8484
8585
8686def test_task_get ():
@@ -140,7 +140,7 @@ def task_func():
140140 assert task_obj ._status == "running"
141141 task_obj .stop ()
142142 task_obj .join ()
143- assert task_obj ._status == "stopped "
143+ assert task_obj ._status == "cancelled "
144144 assert task_obj ._return_value is None
145145
146146
@@ -155,7 +155,7 @@ def task_func():
155155 assert task_obj ._status == "running"
156156 task_obj .stop (timeout = 0 )
157157 task_obj .join ()
158- assert task_obj ._status == "terminated "
158+ assert task_obj ._status == "cancelled "
159159 assert task_obj ._return_value is None
160160
161161
@@ -170,7 +170,7 @@ def task_func():
170170 assert task_obj ._status == "running"
171171 task_obj .terminate ()
172172 task_obj .join ()
173- assert task_obj ._status == "terminated "
173+ assert task_obj ._status == "cancelled "
174174 assert task_obj ._return_value is None
175175
176176
@@ -184,30 +184,6 @@ def task_func():
184184 assert task_obj .terminate () is False
185185
186186
187- def test_task_log_list ():
188- import logging
189- import os
190-
191- logging .getLogger ().setLevel ("INFO" )
192-
193- def task_func ():
194- logging .warning ("Task warning" )
195- for i in range (10 ):
196- logging .info (f"Counted to { i } " )
197-
198- task_obj = thread .ActionThread (target = task_func )
199- task_obj .start ()
200- task_obj .started .wait ()
201-
202- task_obj .join ()
203- assert task_obj .log [0 ]["message" ] == "Task warning"
204- assert task_obj .log [0 ]["levelname" ] == "WARNING"
205- assert task_obj .log [0 ]["filename" ] == os .path .basename (__file__ )
206- assert (
207- len (task_obj .log ) == 11
208- ), "Didn't get the right number of log entries - are INFO entries being logged?"
209-
210-
211187def test_task_log_without_thread ():
212188
213189 task_log_handler = thread .ThreadLogHandler ()
0 commit comments