From abc1d2095f18f6c7ff129f3b8bf9eae2d7a6239a Mon Sep 17 00:00:00 2001 From: Tony S Yu Date: Thu, 13 Dec 2012 13:39:32 -0500 Subject: [PATCH] BUG: Fix file URI in test (2nd attempt) --- skimage/io/tests/test_io.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/skimage/io/tests/test_io.py b/skimage/io/tests/test_io.py index aa48ac1a..484784ee 100644 --- a/skimage/io/tests/test_io.py +++ b/skimage/io/tests/test_io.py @@ -20,7 +20,10 @@ def test_stack_non_array(): def test_imread_url(): - image_url = 'file:{0}{0}{1}{0}camera.png'.format(os.path.sep, data_dir) + # tweak data path so that file URI works on both unix and windows. + data_path = data_dir.lstrip(os.path.sep) + data_path = data_path.replace(os.path.sep, '/') + image_url = 'file:///{0}/camera.png'.format(data_path) image = io.imread(image_url) assert image.shape == (512, 512)