File tree Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Original file line number Diff line number Diff line change 28
28
UpdateMethodMultiParam ,
29
29
)
30
30
31
+ DEFAULT_WORKER_KWARGS : dict [str , Any ] = {}
32
+
31
33
32
34
def new_worker (
33
35
client : Client ,
@@ -47,7 +49,7 @@ def new_worker(
47
49
workflow_runner = workflow_runner ,
48
50
max_cached_workflows = max_cached_workflows ,
49
51
workflow_failure_exception_types = workflow_failure_exception_types ,
50
- ** kwargs ,
52
+ ** ( DEFAULT_WORKER_KWARGS | kwargs ) ,
51
53
)
52
54
53
55
Original file line number Diff line number Diff line change
1
+ """
2
+ Run tests in test_workflow.py with different worker configurations.
3
+ """
4
+
5
+ import inspect
6
+
7
+ import pytest
8
+
9
+ import tests .helpers
10
+ import tests .worker .test_workflow as test_workflow_module
11
+
12
+ _worker_configs = [
13
+ pytest .param (
14
+ {
15
+ "max_concurrent_workflow_tasks" : 2 ,
16
+ "max_concurrent_workflow_task_polls" : 2 ,
17
+ },
18
+ id = "max_concurrent_workflow_tasks_2_polls_2" ,
19
+ ),
20
+ ]
21
+
22
+
23
+ @pytest .fixture (scope = "module" , autouse = True , params = _worker_configs )
24
+ def worker_config (request ):
25
+ original_kwargs = tests .helpers .DEFAULT_WORKER_KWARGS .copy ()
26
+ tests .helpers .DEFAULT_WORKER_KWARGS .update (request .param )
27
+ yield
28
+ tests .helpers .DEFAULT_WORKER_KWARGS .clear ()
29
+ tests .helpers .DEFAULT_WORKER_KWARGS .update (original_kwargs )
30
+
31
+
32
+ for name , fn in inspect .getmembers (test_workflow_module , inspect .isfunction ):
33
+ if name .startswith ("test_" ):
34
+ globals ()[name ] = fn
You can’t perform that action at this time.
0 commit comments