Skip to content

Commit 2cb8260

Browse files
author
Joel Collins
committed
Updated thread logging test
1 parent b4d4972 commit 2cb8260

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

tests/test_tasks_thread.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,19 +97,16 @@ def test_task_log_list():
9797
def task_func():
9898
logging.warning("Task warning")
9999
for i in range(10):
100-
time.sleep(0.001)
101100
logging.info(f"Counted to {i}")
102101

103102
task_obj = thread.ActionThread(target=task_func)
104103
task_obj.start()
105104
task_obj.started.wait()
106105

107-
assert len(task_obj.log) >= 1
106+
task_obj.join()
108107
assert task_obj.log[0]["message"] == "Task warning"
109108
assert task_obj.log[0]["levelname"] == "WARNING"
110109
assert task_obj.log[0]["filename"] == os.path.basename(__file__)
111-
112-
task_obj.join()
113110
assert (
114111
len(task_obj.log) == 11
115112
), "Didn't get the right number of log entries - are INFO entries being logged?"

0 commit comments

Comments
 (0)