@@ -72,13 +72,13 @@ async def comp_task_listening_task(
72
72
@pytest .mark .parametrize (
73
73
"update_values, expected_calls" ,
74
74
[
75
- # pytest.param(
76
- # {
77
- # "outputs": {"some new stuff": "it is new"},
78
- # },
79
- # ["_get_project_owner", "_update_project_outputs"],
80
- # id="new output shall trigger",
81
- # ),
75
+ pytest .param (
76
+ {
77
+ "outputs" : {"some new stuff" : "it is new" },
78
+ },
79
+ ["_get_project_owner" , "_update_project_outputs" ],
80
+ id = "new output shall trigger" ,
81
+ ),
82
82
pytest .param (
83
83
{"state" : StateType .ABORTED },
84
84
["_get_project_owner" , "_update_project_state" ],
@@ -122,18 +122,18 @@ async def test_listen_comp_tasks_task(
122
122
.where (comp_tasks .c .task_id == task ["task_id" ])
123
123
)
124
124
125
- # tests whether calls executed
125
+ # tests whether listener gets hooked calls executed
126
126
for call_name , mocked_call in mock_project_subsystem .items ():
127
127
if call_name in expected_calls :
128
- for attempt in tenacity .Retrying (
128
+ # async.sleep if and retry if not called
129
+ async for attempt in tenacity .AsyncRetrying (
129
130
wait = tenacity .wait_fixed (1 ),
130
131
stop = tenacity .stop_after_delay (10 ),
131
132
retry = tenacity .retry_if_exception_type (AssertionError ),
132
133
before = tenacity .before_log (logger , logging .INFO ),
133
134
reraise = True ,
134
135
):
135
136
with attempt :
136
- print (call_name )
137
137
mocked_call .assert_awaited ()
138
138
else :
139
139
mocked_call .assert_not_called ()
0 commit comments