mirror of
https://github.com/beetbox/beets.git
synced 2026-01-23 16:45:37 +01:00
Fix @unittest.skipIf annotations to ignore only win32
This commit is contained in:
parent
ec06694097
commit
0132067a29
5 changed files with 20 additions and 10 deletions
|
|
@ -107,7 +107,8 @@ class ImportConvertTest(unittest.TestCase, TestHelper):
|
|||
item = self.lib.items().get()
|
||||
self.assertFileTag(item.path, 'convert')
|
||||
|
||||
@unittest.skipIf(sys.platform, 'win32') # FIXME: fails on windows
|
||||
# FIXME: fails on windows
|
||||
@unittest.skipIf(sys.platform == 'win32', 'win32')
|
||||
def test_import_original_on_convert_error(self):
|
||||
# `false` exits with non-zero code
|
||||
self.config['convert']['command'] = 'false'
|
||||
|
|
|
|||
|
|
@ -63,7 +63,8 @@ class HookTest(_common.TestCase, TestHelper):
|
|||
|
||||
self.assertIn('hook: invalid command ""', logs)
|
||||
|
||||
@unittest.skipIf(sys.platform, 'win32') # FIXME: fails on windows
|
||||
# FIXME: fails on windows
|
||||
@unittest.skipIf(sys.platform == 'win32', 'win32')
|
||||
def test_hook_non_zero_exit(self):
|
||||
self._add_hook('test_event', 'sh -c "exit 1"')
|
||||
|
||||
|
|
@ -86,7 +87,8 @@ class HookTest(_common.TestCase, TestHelper):
|
|||
message.startswith("hook: hook for test_event failed: ")
|
||||
for message in logs))
|
||||
|
||||
@unittest.skipIf(sys.platform, 'win32') # FIXME: fails on windows
|
||||
# FIXME: fails on windows
|
||||
@unittest.skipIf(sys.platform == 'win32', 'win32')
|
||||
def test_hook_no_arguments(self):
|
||||
temporary_paths = [
|
||||
get_temporary_path() for i in range(self.TEST_HOOK_COUNT)
|
||||
|
|
@ -105,7 +107,8 @@ class HookTest(_common.TestCase, TestHelper):
|
|||
self.assertTrue(os.path.isfile(path))
|
||||
os.remove(path)
|
||||
|
||||
@unittest.skipIf(sys.platform, 'win32') # FIXME: fails on windows
|
||||
# FIXME: fails on windows
|
||||
@unittest.skipIf(sys.platform == 'win32', 'win32')
|
||||
def test_hook_event_substitution(self):
|
||||
temporary_directory = tempfile._get_default_tempdir()
|
||||
event_names = [f'test_event_event_{i}' for i in
|
||||
|
|
@ -126,7 +129,8 @@ class HookTest(_common.TestCase, TestHelper):
|
|||
self.assertTrue(os.path.isfile(path))
|
||||
os.remove(path)
|
||||
|
||||
@unittest.skipIf(sys.platform, 'win32') # FIXME: fails on windows
|
||||
# FIXME: fails on windows
|
||||
@unittest.skipIf(sys.platform == 'win32', 'win32')
|
||||
def test_hook_argument_substitution(self):
|
||||
temporary_paths = [
|
||||
get_temporary_path() for i in range(self.TEST_HOOK_COUNT)
|
||||
|
|
@ -145,7 +149,8 @@ class HookTest(_common.TestCase, TestHelper):
|
|||
self.assertTrue(os.path.isfile(path))
|
||||
os.remove(path)
|
||||
|
||||
@unittest.skipIf(sys.platform, 'win32') # FIXME: fails on windows
|
||||
# FIXME: fails on windows
|
||||
@unittest.skipIf(sys.platform == 'win32', 'win32')
|
||||
def test_hook_bytes_interpolation(self):
|
||||
temporary_paths = [
|
||||
get_temporary_path().encode('utf-8')
|
||||
|
|
|
|||
|
|
@ -72,7 +72,8 @@ class PlayPluginTest(unittest.TestCase, TestHelper):
|
|||
self.run_and_assert(
|
||||
open_mock, ['title:aNiceTitle'], 'echo other')
|
||||
|
||||
@unittest.skipIf(sys.platform, 'win32') # FIXME: fails on windows
|
||||
# FIXME: fails on windows
|
||||
@unittest.skipIf(sys.platform == 'win32', 'win32')
|
||||
def test_relative_to(self, open_mock):
|
||||
self.config['play']['command'] = 'echo'
|
||||
self.config['play']['relative_to'] = '/something'
|
||||
|
|
|
|||
|
|
@ -425,7 +425,8 @@ class PathQueryTest(_common.LibTestCase, TestHelper, AssertsMixin):
|
|||
results = self.lib.albums(q)
|
||||
self.assert_albums_matched(results, [])
|
||||
|
||||
@unittest.skipIf(sys.platform, 'win32') # FIXME: fails on windows
|
||||
# FIXME: fails on windows
|
||||
@unittest.skipIf(sys.platform == 'win32', 'win32')
|
||||
def test_parent_directory_no_slash(self):
|
||||
q = 'path:/a'
|
||||
results = self.lib.items(q)
|
||||
|
|
@ -434,7 +435,8 @@ class PathQueryTest(_common.LibTestCase, TestHelper, AssertsMixin):
|
|||
results = self.lib.albums(q)
|
||||
self.assert_albums_matched(results, ['path album'])
|
||||
|
||||
@unittest.skipIf(sys.platform, 'win32') # FIXME: fails on windows
|
||||
# FIXME: fails on windows
|
||||
@unittest.skipIf(sys.platform == 'win32', 'win32')
|
||||
def test_parent_directory_with_slash(self):
|
||||
q = 'path:/a/'
|
||||
results = self.lib.items(q)
|
||||
|
|
|
|||
|
|
@ -918,7 +918,8 @@ class ConfigTest(unittest.TestCase, TestHelper, _common.Assertions):
|
|||
# '--config', cli_overwrite_config_path, 'test')
|
||||
# self.assertEqual(config['anoption'].get(), 'cli overwrite')
|
||||
|
||||
@unittest.skipIf(sys.platform, 'win32') # FIXME: fails on windows
|
||||
# FIXME: fails on windows
|
||||
@unittest.skipIf(sys.platform == 'win32', 'win32')
|
||||
def test_cli_config_paths_resolve_relative_to_user_dir(self):
|
||||
cli_config_path = os.path.join(self.temp_dir, b'config.yaml')
|
||||
with open(cli_config_path, 'w') as file:
|
||||
|
|
|
|||
Loading…
Reference in a new issue