Skip to content

Commit 7e90516

Browse files
committed
use pathlib.Path for tmpdir fixture
1 parent 263b9a9 commit 7e90516

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/test_prediction.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from pathlib import Path
2+
13
import imageio
24
import numpy as np
35
import pytest
@@ -24,12 +26,12 @@ def test_predict_image(unet2d_fixed_shape_or_not, tmpdir):
2426
assert isinstance(spec, Model)
2527
inputs = spec.test_inputs
2628

27-
outputs = [tmpdir / f"out{i}.npy" for i in range(len(spec.test_outputs))]
29+
outputs = [Path(tmpdir) / f"out{i}.npy" for i in range(len(spec.test_outputs))]
2830
predict_image(any_model, inputs, outputs)
2931
for out_path in outputs:
3032
assert out_path.exists()
3133

32-
result = [np.load(p) for p in outputs]
34+
result = [np.load(str(p)) for p in outputs]
3335
expected = [np.load(str(p)) for p in spec.test_outputs]
3436
for res, exp in zip(result, expected):
3537
assert_array_almost_equal(res, exp, decimal=4)

0 commit comments

Comments
 (0)