Skip to content

Commit 688eb7e

Browse files
committed
add test_cli_package_wo_cache
1 parent b88e1e8 commit 688eb7e

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tests/test_cli.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
import subprocess
23
from typing import Sequence
34

@@ -7,9 +8,9 @@
78
from bioimageio.core import load_resource_description
89

910

10-
def run_subprocess(commands: Sequence[str]) -> subprocess.CompletedProcess:
11+
def run_subprocess(commands: Sequence[str], **kwargs) -> subprocess.CompletedProcess:
1112
# return subprocess.run(commands, capture_output=True)
12-
return subprocess.run(commands, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, encoding="utf-8")
13+
return subprocess.run(commands, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, encoding="utf-8", **kwargs)
1314

1415

1516
def test_validate_model(unet2d_nuclei_broad_model):
@@ -24,6 +25,13 @@ def test_cli_package(unet2d_nuclei_broad_model, tmp_path):
2425
assert out_path.exists()
2526

2627

28+
def test_cli_package_wo_cache(unet2d_nuclei_broad_model):
29+
env = os.environ.copy()
30+
env["BIOIMAGEIO_NO_CACHE"] = "True"
31+
ret = run_subprocess(["bioimageio", "package", unet2d_nuclei_broad_model], env=env)
32+
assert ret.returncode == 0, ret.stdout
33+
34+
2735
def test_cli_test_model(unet2d_nuclei_broad_model):
2836
ret = run_subprocess(["bioimageio", "test-model", unet2d_nuclei_broad_model])
2937
assert ret.returncode == 0, ret.stdout

0 commit comments

Comments
 (0)