Skip to content

Commit 652a70f

Browse files
NicolasHugdatumbox
andauthored
better cond (#3548)
Co-authored-by: Vasilis Vryniotis <datumbox@users.noreply.github.com>
1 parent 9a08e47 commit 652a70f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

test/test_datasets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def test_fashionmnist(self, mock_download_extract):
147147
self.assertEqual(dataset.class_to_idx[dataset.classes[0]], target)
148148

149149
@mock.patch('torchvision.datasets.WIDERFace._check_integrity')
150-
@unittest.skipIf('win' in sys.platform, 'temporarily disabled on Windows')
150+
@unittest.skipIf(sys.platform in ('win32', 'cygwin'), 'temporarily disabled on Windows')
151151
def test_widerface(self, mock_check_integrity):
152152
mock_check_integrity.return_value = True
153153
with widerface_root() as root:
@@ -166,7 +166,7 @@ def test_widerface(self, mock_check_integrity):
166166
img, target = dataset[0]
167167
self.assertTrue(isinstance(img, PIL.Image.Image))
168168

169-
@unittest.skipIf('win' in sys.platform, 'temporarily disabled on Windows')
169+
@unittest.skipIf(sys.platform in ('win32', 'cygwin'), 'temporarily disabled on Windows')
170170
def test_cityscapes(self):
171171
with cityscapes_root() as root:
172172

test/test_utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,21 @@ def test_normalize_in_make_grid(self):
4242
self.assertTrue(torch.equal(norm_max, rounded_grid_max), 'Normalized max is not equal to 1')
4343
self.assertTrue(torch.equal(norm_min, rounded_grid_min), 'Normalized min is not equal to 0')
4444

45-
@unittest.skipIf('win' in sys.platform, 'temporarily disabled on Windows')
45+
@unittest.skipIf(sys.platform in ('win32', 'cygwin'), 'temporarily disabled on Windows')
4646
def test_save_image(self):
4747
with tempfile.NamedTemporaryFile(suffix='.png') as f:
4848
t = torch.rand(2, 3, 64, 64)
4949
utils.save_image(t, f.name)
5050
self.assertTrue(os.path.exists(f.name), 'The image is not present after save')
5151

52-
@unittest.skipIf('win' in sys.platform, 'temporarily disabled on Windows')
52+
@unittest.skipIf(sys.platform in ('win32', 'cygwin'), 'temporarily disabled on Windows')
5353
def test_save_image_single_pixel(self):
5454
with tempfile.NamedTemporaryFile(suffix='.png') as f:
5555
t = torch.rand(1, 3, 1, 1)
5656
utils.save_image(t, f.name)
5757
self.assertTrue(os.path.exists(f.name), 'The pixel image is not present after save')
5858

59-
@unittest.skipIf('win' in sys.platform, 'temporarily disabled on Windows')
59+
@unittest.skipIf(sys.platform in ('win32', 'cygwin'), 'temporarily disabled on Windows')
6060
def test_save_image_file_object(self):
6161
with tempfile.NamedTemporaryFile(suffix='.png') as f:
6262
t = torch.rand(2, 3, 64, 64)
@@ -68,7 +68,7 @@ def test_save_image_file_object(self):
6868
self.assertTrue(torch.equal(F.to_tensor(img_orig), F.to_tensor(img_bytes)),
6969
'Image not stored in file object')
7070

71-
@unittest.skipIf('win' in sys.platform, 'temporarily disabled on Windows')
71+
@unittest.skipIf(sys.platform in ('win32', 'cygwin'), 'temporarily disabled on Windows')
7272
def test_save_image_single_pixel_file_object(self):
7373
with tempfile.NamedTemporaryFile(suffix='.png') as f:
7474
t = torch.rand(1, 3, 1, 1)

0 commit comments

Comments
 (0)