Skip to content

Commit

Permalink
Fix tests expecting an explicit result ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvanrun committed Aug 1, 2024
1 parent cd3f0e1 commit e37a835
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ def run_prediction_processing(*, fn, predictions):
- if any child process is terminated, all prediction processing will abort
- after prediction processing is done, all child processes are terminated
Note that the results are returned in completing order.
Parameters
----------
fn : function
Expand Down
4 changes: 3 additions & 1 deletion tests/test_evaluate_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@


def working_process(p):
if p == "prediction1":
time.sleep(2)
return f"{p} result"


Expand Down Expand Up @@ -75,7 +77,7 @@ def test_prediction_processing():
result = run_prediction_processing(
fn=working_process, predictions=predictions
)
assert ["prediction1 result", "prediction2 result"] == result
assert {"prediction1 result", "prediction2 result"} == set(result)


def test_prediction_processing_error():
Expand Down

0 comments on commit e37a835

Please sign in to comment.