aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2023-01-12 22:47:51 +0100
committerTrygve Aaberge <trygveaa@gmail.com>2024-02-18 11:32:53 +0100
commitadf20323ce99e8829a2ab53f8d487f5704d28320 (patch)
tree85c008fdc7c115c9d0d9cc2eaf056cc0aab83b5b /tests
parent7574554b09eacb7aaaa8610d73fef6bd9d8a363f (diff)
downloadwee-slack-adf20323ce99e8829a2ab53f8d487f5704d28320.tar.gz
Don't fetch the same user multiple times
Diffstat (limited to 'tests')
-rw-r--r--tests/test_task_runner.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/test_task_runner.py b/tests/test_task_runner.py
index 17a3ec8..ca4f78b 100644
--- a/tests/test_task_runner.py
+++ b/tests/test_task_runner.py
@@ -1,9 +1,11 @@
+from collections import defaultdict
+
from slack.shared import shared
from slack.task import Future, create_task, weechat_task_cb
def test_run_single_task():
- shared.active_tasks = {}
+ shared.active_tasks = defaultdict(list)
shared.active_responses = {}
future = Future[str]()
@@ -19,7 +21,7 @@ def test_run_single_task():
def test_run_nested_task():
- shared.active_tasks = {}
+ shared.active_tasks = defaultdict(list)
shared.active_responses = {}
future = Future[str]()
@@ -41,7 +43,7 @@ def test_run_nested_task():
def test_run_two_tasks_concurrently():
- shared.active_tasks = {}
+ shared.active_tasks = defaultdict(list)
shared.active_responses = {}
future1 = Future[str]()
future2 = Future[str]()