Skip to content

Commit d362dbc

Browse files
committed
fix tests
1 parent 13519e5 commit d362dbc

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

tests/build_spec/test_add_weights.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ def _test_add_weights(model, tmp_path, base_weights, added_weights, **kwargs):
3131
assert weight.source.exists()
3232

3333
test_res = _test_model(out_path, added_weights)
34+
assert all([s["status"] == "passed" for s in test_res])
3435
test_res = _test_model(out_path)
35-
assert test_res["error"] is None
36+
assert all([s["status"] == "passed" for s in test_res])
3637

3738
# make sure the weights were cleaned from the cwd
3839
assert not os.path.exists(os.path.split(weight_path)[1])

tests/build_spec/test_build_spec.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def _test_build_spec(
152152

153153
# test inference for the model to ensure that the weights were written correctly
154154
test_res = _test_model(out_path)
155-
assert test_res["error"] is None
155+
assert all([s["status"] == "passed" for s in test_res])
156156

157157

158158
def test_build_spec_pytorch(any_torch_model, tmp_path):
@@ -209,7 +209,7 @@ def test_build_spec_training_data2(unet2d_nuclei_broad_model, tmp_path):
209209

210210

211211
def test_build_spec_parent1(unet2d_nuclei_broad_model, tmp_path):
212-
parent = {"uri": "https:/my-parent-model.org"}
212+
parent = {"uri": "https://doi.org/10.5281/zenodo.5764892"}
213213
_test_build_spec(unet2d_nuclei_broad_model, tmp_path / "model.zip", "torchscript", parent=parent)
214214

215215

tests/test_resource_tests/test_test_model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ def test_validation_section_warning(unet2d_nuclei_broad_model, tmp_path: pathlib
4646

4747
model = load_resource_description(unet2d_nuclei_broad_model)
4848

49-
summary = test_resource(model)[1]
49+
summary = test_resource(model)[2]
5050
assert summary["name"] == "Test documentation completeness."
5151
assert summary["warnings"] == {"documentation": "No '# Validation' (sub)section found."}
5252
assert summary["status"] == "passed"
5353

5454
doc_with_validation = tmp_path / "doc.md"
5555
doc_with_validation.write_text("# Validation\nThis is a section about how to validate the model on new data")
5656
model.documentation = doc_with_validation
57-
summary = test_resource(model)[1]
57+
summary = test_resource(model)[2]
5858
assert summary["name"] == "Test documentation completeness."
5959
assert summary["warnings"] == {}
6060
assert summary["status"] == "passed"

0 commit comments

Comments
 (0)