Skip to content

Commit

Permalink
Merge branch 'SBU-BMI:main' into fix/GeoJSON_ID
Browse files Browse the repository at this point in the history
  • Loading branch information
swaradgat19 authored Aug 8, 2023
2 parents 44c6d9b + b0438af commit 69e8392
Showing 1 changed file with 37 additions and 3 deletions.
40 changes: 37 additions & 3 deletions tests/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
from wsinfer.modellib.models import get_pretrained_torch_module
from wsinfer.modellib.models import get_registered_model
from wsinfer.modellib.run_inference import jit_compile
from wsinfer.wsi import HAS_OPENSLIDE
from wsinfer.wsi import HAS_TIFFSLIDE


@pytest.fixture
Expand Down Expand Up @@ -58,7 +60,23 @@ def tiff_image(tmp_path: Path) -> Path:
],
)
@pytest.mark.parametrize("speedup", [False, True])
@pytest.mark.parametrize("backend", ["openslide", "tiffslide"])
@pytest.mark.parametrize(
"backend",
[
pytest.param(
"openslide",
marks=pytest.mark.skipif(
not HAS_OPENSLIDE, reason="OpenSlide not available"
),
),
pytest.param(
"tiffslide",
marks=pytest.mark.skipif(
not HAS_TIFFSLIDE, reason="TiffSlide not available"
),
),
],
)
def test_cli_run_with_registered_models(
model: str,
speedup: bool,
Expand Down Expand Up @@ -198,7 +216,7 @@ def test_cli_run_with_local_model(tmp_path: Path, tiff_image: Path):
cli,
[
"--backend",
"openslide",
"tiffslide",
"run",
"--wsi-dir",
str(tiff_image.parent),
Expand Down Expand Up @@ -290,7 +308,23 @@ def test_convert_to_sbu():
["patch_size", "patch_spacing"],
[(256, 0.25), (256, 0.50), (350, 0.25), (100, 0.3), (100, 0.5)],
)
@pytest.mark.parametrize("backend", ["openslide", "tiffslide"])
@pytest.mark.parametrize(
"backend",
[
pytest.param(
"openslide",
marks=pytest.mark.skipif(
not HAS_OPENSLIDE, reason="OpenSlide not available"
),
),
pytest.param(
"tiffslide",
marks=pytest.mark.skipif(
not HAS_TIFFSLIDE, reason="TiffSlide not available"
),
),
],
)
def test_patch_cli(
patch_size: int,
patch_spacing: float,
Expand Down

0 comments on commit 69e8392

Please sign in to comment.