Skip to content

Commit 7f30507

Browse files
committed
test_model returns summary dict
1 parent 36d7a68 commit 7f30507

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

bioimageio/core/__main__.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import typer
99

10-
from bioimageio.core import __version__, prediction, commands
10+
from bioimageio.core import __version__, prediction, commands, resource_tests
1111
from bioimageio.spec.__main__ import app
1212

1313
try:
@@ -52,16 +52,17 @@ def test_model(
5252
# this is a weird typer bug: default devices are empty tuple although they should be None
5353
if len(devices) == 0:
5454
devices = None
55-
test_passed = prediction.test_model(model_rdf, weight_format=weight_format, devices=devices, decimal=decimal)
56-
if test_passed:
55+
summary = resource_tests.test_model(model_rdf, weight_format=weight_format, devices=devices, decimal=decimal)
56+
if summary["error"] is None:
5757
print(f"Model test for {model_rdf} has passed.")
58+
return 0
5859
else:
5960
print(f"Model test for {model_rdf} has FAILED!")
60-
ret_code = 0 if test_passed else 1
61-
return ret_code
61+
print(summary)
62+
return 1
6263

6364

64-
test_model.__doc__ = prediction.test_model.__doc__
65+
test_model.__doc__ = resource_tests.test_model.__doc__
6566

6667

6768
@app.command()

0 commit comments

Comments
 (0)