Skip to content

Commit 4e454c0

Browse files
committed
Fix paths in test (use pathlib)
1 parent 7e397f9 commit 4e454c0

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

napari_cellseg3d/_tests/test_utils.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,17 +209,29 @@ def test_parse_default_path():
209209
user_path = Path().home()
210210
assert utils.parse_default_path([None]) == str(user_path)
211211

212-
test_path = "C:/test/test/test/test"
212+
test_path = Path("C:") / "test" / "test" / "test" / "test"
213213
path = [test_path, None, None]
214214
assert utils.parse_default_path(path, check_existence=False) == test_path
215215

216-
test_path = "C:/test/does/not/exist"
216+
test_path = Path("C:") / "test" / "does" / "not" / "exist"
217217
path = [test_path, None, None]
218218
assert utils.parse_default_path(path, check_existence=True) == str(
219219
Path.home()
220220
)
221221

222-
long_path = "D:/very/long/path/what/a/bore/ifonlytherewas/something/tohelpmenotsearchit/allthetime"
222+
long_path = Path("D:")
223+
long_path = (
224+
long_path
225+
/ "very"
226+
/ "long"
227+
/ "path"
228+
/ "what"
229+
/ "a"
230+
/ "bore"
231+
/ "ifonlytherewassomething"
232+
/ "tohelpmenotsearchit"
233+
/ "allthetime"
234+
)
223235
path = [test_path, None, None, long_path, ""]
224236
assert utils.parse_default_path(path, check_existence=False) == long_path
225237

0 commit comments

Comments
 (0)