Skip to content

Commit 1f74213

Browse files
author
Thomas Scholtes
committed
Catch all archive extract errors and skip tests without unrar
1 parent 68595ee commit 1f74213

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

beets/importer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ def read_tasks(session):
665665
archive_task = ArchiveImportTask(toppath)
666666
try:
667667
archive_task.extract()
668-
except IOError as exc:
668+
except Exception as exc:
669669
log.error('extraction failed: {0}'.format(exc))
670670
continue
671671
toppath = archive_task.toppath

test/test_importer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
import _common
2525
from _common import unittest
26-
from helper import TestImportSession, TestHelper
26+
from helper import TestImportSession, TestHelper, has_program
2727
from beets import library
2828
from beets import importer
2929
from beets.mediafile import MediaFile
@@ -342,6 +342,7 @@ def create_archive(self):
342342
return path
343343

344344

345+
@unittest.skipIf(not has_program('unrar'), 'unrar program not found')
345346
class ImportRarTest(ImportZipTest):
346347

347348
def create_archive(self):

0 commit comments

Comments
 (0)