Skip to content

Commit

Permalink
specify reason for skipping
Browse files Browse the repository at this point in the history
  • Loading branch information
FynnBe committed Oct 16, 2023
1 parent e9f312e commit 3dc6c4e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
2 changes: 0 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import pytest

SKIP_ZENODO = True # skip tests relying on zenodo


@pytest.fixture
def unet2d_nuclei_broad_base_path():
Expand Down
3 changes: 2 additions & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from bioimageio.spec.shared import yaml

SKIP_ZENODO = True
SKIP_ZENODO_REASON = "zenodo api changes"


def run_subprocess(commands: Sequence[str], **kwargs) -> subprocess.CompletedProcess:
Expand Down Expand Up @@ -49,7 +50,7 @@ def test_cli_validate_model_url_wo_cache():
assert ret.returncode == 0


@pytest.mark.skipif(SKIP_ZENODO)
@pytest.mark.skipif(SKIP_ZENODO, reason=SKIP_ZENODO_REASON)
def test_cli_validate_model_doi():
ret = run_subprocess(["bioimageio", "validate", "10.5281/zenodo.5744489"])
assert ret.returncode == 0
Expand Down
9 changes: 5 additions & 4 deletions tests/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from bioimageio.spec.shared import yaml

SKIP_ZENODO = True
SKIP_ZENODO_REASON = "zenodo api changes"


def test_validate_dataset(dataset_rdf):
Expand Down Expand Up @@ -45,15 +46,15 @@ def test_validate_model_as_url():
)["error"]


@pytest.mark.skipif(SKIP_ZENODO)
@pytest.mark.skipif(SKIP_ZENODO, reason=SKIP_ZENODO_REASON)
def test_validate_model_as_zenodo_sandbox_doi():
from bioimageio.spec.commands import validate

doi = "10.5281/zenodo.5744489"
assert not validate(doi, update_format=False, update_format_inner=False)["error"]


@pytest.mark.skipif(SKIP_ZENODO)
@pytest.mark.skipif(SKIP_ZENODO, reason=SKIP_ZENODO_REASON)
def test_validate_model_as_zenodo_doi():
from bioimageio.spec.commands import validate

Expand All @@ -72,7 +73,7 @@ def test_validate_model_as_bioimageio_full_version_id_partner():
assert summary["status"] == "passed", summary["error"]


@pytest.mark.skipif(SKIP_ZENODO)
@pytest.mark.skipif(SKIP_ZENODO, reason=SKIP_ZENODO_REASON)
def test_validate_model_as_bioimageio_full_version_id_zenodo():
from bioimageio.spec.commands import validate

Expand All @@ -89,7 +90,7 @@ def test_validate_model_as_bioimageio_resource_id_partner():
assert summary["status"] == "passed", summary["error"]


@pytest.mark.skipif(SKIP_ZENODO)
@pytest.mark.skipif(SKIP_ZENODO, reason=SKIP_ZENODO_REASON)
def test_validate_model_as_bioimageio_resource_id_zenodo():
from bioimageio.spec.commands import validate

Expand Down
5 changes: 3 additions & 2 deletions tests/test_schema_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from bioimageio.spec.shared import yaml

SKIP_ZENODO = True
SKIP_ZENODO_REASON = "zenodo api changes"


def test_model_rdf_is_valid_general_rdf(unet2d_nuclei_broad_latest):
Expand Down Expand Up @@ -218,7 +219,7 @@ def test_output_ref_shape_too_small(model_dict):
}


@pytest.mark.skipif(SKIP_ZENODO)
@pytest.mark.skipif(SKIP_ZENODO, reason=SKIP_ZENODO_REASON)
def test_model_has_parent_with_uri(model_dict):
from bioimageio.spec.model.schema import Model

Expand All @@ -228,7 +229,7 @@ def test_model_has_parent_with_uri(model_dict):
assert isinstance(valid_data, raw_nodes_m04.Model)


@pytest.mark.skipif(SKIP_ZENODO)
@pytest.mark.skipif(SKIP_ZENODO, reason=SKIP_ZENODO_REASON)
def test_model_has_parent_with_id(model_dict):
from bioimageio.spec.model.schema import Model

Expand Down

0 comments on commit 3dc6c4e

Please sign in to comment.