We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d156aad commit 5450e9dCopy full SHA for 5450e9d
1 file changed
tests/abc/test_broker.py
@@ -1,4 +1,5 @@
1
from collections.abc import AsyncGenerator
2
+from copy import copy
3
4
from taskiq.abc.broker import AsyncBroker
5
from taskiq.decor import AsyncTaskiqDecoratedTask
@@ -61,3 +62,17 @@ async def test_func() -> None:
61
62
"label1": 1,
63
"label2": 2,
64
}
65
+
66
67
+def test_kicker_labels_modification() -> None:
68
+ """Test that using kicker.with_labels doesn't modify task's labels globally."""
69
+ broker = _TestBroker()
70
71
+ @broker.task(test_lb="one")
72
+ async def test_task() -> None: ...
73
74
+ old_labels = copy(test_task.labels)
75
+ test_kicker = test_task.kicker().with_labels(another_label="test")
76
+ assert "another_label" in test_kicker.labels
77
78
+ assert test_task.labels == old_labels
0 commit comments