|
151 | 151 | "# before using a model, it is recommended to check that it properly works with this function\n",
|
152 | 152 | "# 'test_model' returns a dict with 'status'='passed'/'failed' and more detailed information\n",
|
153 | 153 | "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\")" |
163 | 163 | ]
|
164 | 164 | },
|
165 | 165 | {
|
|
0 commit comments