|
1 | 1 | import importlib.util as getmod
|
2 | 2 | import os
|
3 | 3 | import runpy
|
| 4 | +import sys |
4 | 5 | import unittest
|
5 | 6 |
|
6 | 7 | from pathlib import Path
|
@@ -69,11 +70,13 @@ def test_file_create(self):
|
69 | 70 | os.remove("file_create_example.nix")
|
70 | 71 |
|
71 | 72 | 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") |
77 | 80 |
|
78 | 81 | def test_image_with_metadata(self):
|
79 | 82 | # Requires PIL package and the "Lenna" image.
|
@@ -119,11 +122,13 @@ def test_regularly_sampled_data(self):
|
119 | 122 | os.remove("regular_data_example.nix")
|
120 | 123 |
|
121 | 124 | 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") |
127 | 132 |
|
128 | 133 | def test_sources(self):
|
129 | 134 | self.run_script("sources.py")
|
|
0 commit comments