Skip to content

Commit 355fa23

Browse files
committed
changes to test, so the test message are saved properly
1 parent 0e0f380 commit 355fa23

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

reproschema/tests/test_rs2redcap_redcap2rs.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,10 @@ def compare_protocols(prot_tree_orig, prot_tree_final):
220220
)
221221
)
222222
else:
223-
print(
224-
f"Activity {act_name}: addProperties have different elements"
225-
)
226223
errors_list.append(
227-
f"Activity {act_name}: addProperties have different elements"
224+
print_return_msg(
225+
f"Activity {act_name}: addProperties have different elements, orig: {act_props_orig} and final: {act_props_final}"
226+
)
228227
)
229228
else:
230229
for nm, el in act_props_final.items():
@@ -253,8 +252,8 @@ def compare_protocols(prot_tree_orig, prot_tree_final):
253252
error = True
254253
if error:
255254
errors_list.append(
256-
print(
257-
f"Activity {act_name}: addProperties {nm} have different {key}"
255+
print_return_msg(
256+
f"Activity {act_name}: addProperties {nm} have different {key}, orig: {getattr(act_props_orig[nm], key)}, final: {normalize_condition(getattr(el, key))}"
258257
)
259258
)
260259
# check compute
@@ -268,9 +267,10 @@ def compare_protocols(prot_tree_orig, prot_tree_final):
268267
)
269268
)
270269
else:
271-
print(f"Activity {act_name}: compute have different elements")
272270
errors_list.append(
273-
f"Activity {act_name}: compute have different elements"
271+
print_return_msg(
272+
f"Activity {act_name}: compute have different elements, orig: {act_comp_orig}, final: {act_comp_final}"
273+
)
274274
)
275275
else:
276276
for nm, el in act_comp_final.items():
@@ -280,7 +280,7 @@ def compare_protocols(prot_tree_orig, prot_tree_final):
280280
getattr(act_comp_orig[nm], "jsExpression")
281281
):
282282
errors_list.append(
283-
print(
283+
print_return_msg(
284284
f"Activity {act_name}: compute {nm} have different jsExpression"
285285
)
286286
)
@@ -296,7 +296,7 @@ def compare_protocols(prot_tree_orig, prot_tree_final):
296296
else:
297297
errors_list.append(
298298
print_return_msg(
299-
f"Activity {act_name}: items have different elements"
299+
f"Activity {act_name}: items have different elements, orig: {act_items_orig}, final: {act_items_final}"
300300
)
301301
)
302302
else:

0 commit comments

Comments
 (0)