Skip to content

Commit

Permalink
fix test_model returns list of test summaries not single summary
Browse files Browse the repository at this point in the history
  • Loading branch information
FynnBe authored Dec 15, 2023
1 parent 099cc73 commit 7f26c9b
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions example/model_usage.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,15 @@
"# before using a model, it is recommended to check that it properly works with this function\n",
"# 'test_model' returns a dict with 'status'='passed'/'failed' and more detailed information\n",
"from bioimageio.core.resource_tests import test_model\n",
"test_result = test_model(model_resource)\n",
"if test_result[\"status\"] == \"failed\":\n",
" print(\"model test:\", test_result[\"name\"])\n",
" print(\"The model test failed with:\", test_result[\"error\"])\n",
" print(\"with the traceback:\")\n",
" print(\"\".join(test_result[\"traceback\"]))\n",
"else:\n",
" test_result[\"status\"] == \"passed\"\n",
" print(\"The model passed all tests\")"
"for test_result in test_model(model_resource):\n",
" if test_result[\"status\"] == \"failed\":\n",
" print(\"model test:\", test_result[\"name\"])\n",
" print(\"The model test failed with:\", test_result[\"error\"])\n",
" print(\"with the traceback:\")\n",
" print(\"\".join(test_result[\"traceback\"]))\n",
" else:\n",
" test_result[\"status\"] == \"passed\"\n",
" print(\"The model passed all tests\")"
]
},
{
Expand Down

0 comments on commit 7f26c9b

Please sign in to comment.