Catch all archive extract errors and skip tests without unrar

This commit is contained in:
Thomas Scholtes 2014-04-15 18:26:35 +02:00
parent 68595ee09d
commit 1f742130c4
2 changed files with 3 additions and 2 deletions

View file

@ -665,7 +665,7 @@ def read_tasks(session):
archive_task = ArchiveImportTask(toppath)
try:
archive_task.extract()
except IOError as exc:
except Exception as exc:
log.error('extraction failed: {0}'.format(exc))
continue
toppath = archive_task.toppath

View file

@ -23,7 +23,7 @@ from tarfile import TarFile
import _common
from _common import unittest
from helper import TestImportSession, TestHelper
from helper import TestImportSession, TestHelper, has_program
from beets import library
from beets import importer
from beets.mediafile import MediaFile
@ -342,6 +342,7 @@ class ImportTarTest(ImportZipTest):
return path
@unittest.skipIf(not has_program('unrar'), 'unrar program not found')
class ImportRarTest(ImportZipTest):
def create_archive(self):