Skip to content

Commit

Permalink
tests: skip unrar test gracefully if module is missing
Browse files Browse the repository at this point in the history
Fedora (and probably some other distributions) cannot include unrardll
because of licensing reasons. Unfortuantely this situation is unlikely
to change in the near future. Skip the test if the module is not
available.
  • Loading branch information
keszybz committed Aug 20, 2019
1 parent b657ba6 commit 497810f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/calibre/test_build.py
Expand Up @@ -17,6 +17,10 @@

is_ci = os.environ.get('CI', '').lower() == 'true'

try:
import unrardll
except ModuleNotFoundError:
unrardll = None

class BuildTest(unittest.TestCase):

Expand Down Expand Up @@ -236,6 +240,7 @@ def test_file_dialog_helper(self):
from calibre.gui2.win_file_dialogs import test
test()

@unittest.skipUnless(unrardll, 'Module unrardll is missing')
def test_unrar(self):
from calibre.utils.unrar import test_basic
test_basic()
Expand Down

0 comments on commit 497810f

Please sign in to comment.