From c9702a4c24adb19257833c0ee783b4b2ea9329ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0ar=C5=ABnas=20Nejus?= Date: Tue, 16 Jul 2024 14:42:35 +0100 Subject: [PATCH] windows: do not skip test when hiding file fails --- test/plugins/test_fetchart.py | 9 +++++---- test/test_hidden.py | 9 +++------ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/test/plugins/test_fetchart.py b/test/plugins/test_fetchart.py index b3307472a8..0feaa19f76 100644 --- a/test/plugins/test_fetchart.py +++ b/test/plugins/test_fetchart.py @@ -42,11 +42,12 @@ def check_cover_is_stored(self): def hide_file_windows(self): hidden_mask = 2 - success = ctypes.windll.kernel32.SetFileAttributesW( - self.cover_path, hidden_mask + self.assertTrue( + ctypes.windll.kernel32.SetFileAttributesW( + self.cover_path, hidden_mask + ), + "Could not set file attributes", ) - if not success: - self.skipTest("unable to set file attributes") def test_set_art_from_folder(self): self.touch(b"c\xc3\xb6ver.jpg", dir=self.album.path, content="IMAGE") diff --git a/test/test_hidden.py b/test/test_hidden.py index f60f1f6e94..e6bdccba2b 100644 --- a/test/test_hidden.py +++ b/test/test_hidden.py @@ -57,13 +57,10 @@ def test_windows_hidden(self): with tempfile.NamedTemporaryFile() as f: # Hide the file using - success = ctypes.windll.kernel32.SetFileAttributesW( - f.name, hidden_mask + self.assertTrue( + ctypes.windll.kernel32.SetFileAttributesW(f.name, hidden_mask), + "Could not set file attributes", ) - - if not success: - self.skipTest("unable to set file attributes") - self.assertTrue(hidden.is_hidden(f.name)) def test_other_hidden(self):