Skip to content

Commit 4640c78

Browse files
committed
fix test_test_model
1 parent d362dbc commit 4640c78

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

tests/test_resource_tests/test_test_model.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
import pathlib
22

3-
from bioimageio.spec.shared import yaml
4-
53

64
def test_error_for_wrong_shape(stardist_wrong_shape):
75
from bioimageio.core.resource_tests import test_model
86

9-
summary = test_model(stardist_wrong_shape)[0]
7+
summary = test_model(stardist_wrong_shape)[-1]
108
expected_error_message = (
119
"Shape (1, 512, 512, 33) of test output 0 'output' does not match output shape description: "
1210
"ImplicitOutputShape(reference_tensor='input', "
@@ -18,7 +16,7 @@ def test_error_for_wrong_shape(stardist_wrong_shape):
1816
def test_error_for_wrong_shape2(stardist_wrong_shape2):
1917
from bioimageio.core.resource_tests import test_model
2018

21-
summary = test_model(stardist_wrong_shape2)[0]
19+
summary = test_model(stardist_wrong_shape2)[-1]
2220
expected_error_message = (
2321
"Shape (1, 512, 512, 1) of test input 0 'input' does not match input shape description: "
2422
"ParametrizedInputShape(min=[1, 80, 80, 1], step=[0, 17, 17, 0])."
@@ -29,15 +27,15 @@ def test_error_for_wrong_shape2(stardist_wrong_shape2):
2927
def test_test_model(any_model):
3028
from bioimageio.core.resource_tests import test_model
3129

32-
summary = test_model(any_model)[0]
33-
assert summary["error"] is None
30+
summary = test_model(any_model)
31+
assert all([s["status"] for s in summary])
3432

3533

3634
def test_test_resource(any_model):
3735
from bioimageio.core.resource_tests import test_resource
3836

39-
summary = test_resource(any_model)[0]
40-
assert summary["error"] is None
37+
summary = test_resource(any_model)
38+
assert all([s["status"] for s in summary])
4139

4240

4341
def test_validation_section_warning(unet2d_nuclei_broad_model, tmp_path: pathlib.Path):

0 commit comments

Comments
 (0)