@@ -80,7 +80,7 @@ def task_func():
80
80
task_obj .start ()
81
81
task_obj .join ()
82
82
assert task_obj ._return_value == "Return value"
83
- assert task_obj ._status == "success "
83
+ assert task_obj ._status == "completed "
84
84
85
85
86
86
def test_task_get ():
@@ -140,7 +140,7 @@ def task_func():
140
140
assert task_obj ._status == "running"
141
141
task_obj .stop ()
142
142
task_obj .join ()
143
- assert task_obj ._status == "stopped "
143
+ assert task_obj ._status == "cancelled "
144
144
assert task_obj ._return_value is None
145
145
146
146
@@ -155,7 +155,7 @@ def task_func():
155
155
assert task_obj ._status == "running"
156
156
task_obj .stop (timeout = 0 )
157
157
task_obj .join ()
158
- assert task_obj ._status == "terminated "
158
+ assert task_obj ._status == "cancelled "
159
159
assert task_obj ._return_value is None
160
160
161
161
@@ -170,7 +170,7 @@ def task_func():
170
170
assert task_obj ._status == "running"
171
171
task_obj .terminate ()
172
172
task_obj .join ()
173
- assert task_obj ._status == "terminated "
173
+ assert task_obj ._status == "cancelled "
174
174
assert task_obj ._return_value is None
175
175
176
176
@@ -184,30 +184,6 @@ def task_func():
184
184
assert task_obj .terminate () is False
185
185
186
186
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
-
211
187
def test_task_log_without_thread ():
212
188
213
189
task_log_handler = thread .ThreadLogHandler ()
0 commit comments