Skip to content

Commit 839874d

Browse files
committed
[tests/doc] Image open tests only on linux
1 parent 61c515a commit 839874d

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

nixio/test/test_doc_examples.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import importlib.util as getmod
22
import os
33
import runpy
4+
import sys
45
import unittest
56

67
from pathlib import Path
@@ -69,11 +70,13 @@ def test_file_create(self):
6970
os.remove("file_create_example.nix")
7071

7172
def test_image_data(self):
72-
# Requires PIL package and the "Lenna" image.
73-
self.handle_image()
74-
self.run_script("imageData.py")
75-
# cleanup
76-
os.remove("image_example.nix")
73+
# test will open image with an external program; does not work on windows
74+
if sys.platform == 'linux':
75+
# Requires PIL package and the "Lenna" image.
76+
self.handle_image()
77+
self.run_script("imageData.py")
78+
# cleanup
79+
os.remove("image_example.nix")
7780

7881
def test_image_with_metadata(self):
7982
# Requires PIL package and the "Lenna" image.
@@ -119,11 +122,13 @@ def test_regularly_sampled_data(self):
119122
os.remove("regular_data_example.nix")
120123

121124
def test_single_roi(self):
122-
# Requires PIL package and the "Lenna" image.
123-
self.handle_image()
124-
self.run_script("singleROI.py")
125-
# cleanup
126-
os.remove("single_roi.nix")
125+
# test will open image with an external program; does not work on windows
126+
if sys.platform == 'linux':
127+
# Requires PIL package and the "Lenna" image.
128+
self.handle_image()
129+
self.run_script("singleROI.py")
130+
# cleanup
131+
os.remove("single_roi.nix")
127132

128133
def test_sources(self):
129134
self.run_script("sources.py")

0 commit comments

Comments
 (0)