Skip to content

Commit 7f26c9b

Browse files
authored
fix test_model returns list of test summaries not single summary
1 parent 099cc73 commit 7f26c9b

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

example/model_usage.ipynb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,15 @@
151151
"# before using a model, it is recommended to check that it properly works with this function\n",
152152
"# 'test_model' returns a dict with 'status'='passed'/'failed' and more detailed information\n",
153153
"from bioimageio.core.resource_tests import test_model\n",
154-
"test_result = test_model(model_resource)\n",
155-
"if test_result[\"status\"] == \"failed\":\n",
156-
" print(\"model test:\", test_result[\"name\"])\n",
157-
" print(\"The model test failed with:\", test_result[\"error\"])\n",
158-
" print(\"with the traceback:\")\n",
159-
" print(\"\".join(test_result[\"traceback\"]))\n",
160-
"else:\n",
161-
" test_result[\"status\"] == \"passed\"\n",
162-
" print(\"The model passed all tests\")"
154+
"for test_result in test_model(model_resource):\n",
155+
" if test_result[\"status\"] == \"failed\":\n",
156+
" print(\"model test:\", test_result[\"name\"])\n",
157+
" print(\"The model test failed with:\", test_result[\"error\"])\n",
158+
" print(\"with the traceback:\")\n",
159+
" print(\"\".join(test_result[\"traceback\"]))\n",
160+
" else:\n",
161+
" test_result[\"status\"] == \"passed\"\n",
162+
" print(\"The model passed all tests\")"
163163
]
164164
},
165165
{

0 commit comments

Comments
 (0)