5f720ea
From 497810f8adb992bfecf04e8eacf4ac1340ee6fe0 Mon Sep 17 00:00:00 2001
5f720ea
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
5f720ea
Date: Tue, 20 Aug 2019 08:50:58 +0200
5f720ea
Subject: [PATCH] tests: skip unrar test gracefully if module is missing
5f720ea
5f720ea
Fedora (and probably some other distributions) cannot include unrardll
5f720ea
because of licensing reasons. Unfortuantely this situation is unlikely
5f720ea
to change in the near future. Skip the test if the module is not
5f720ea
available.
5f720ea
---
5f720ea
 src/calibre/test_build.py | 5 +++++
5f720ea
 1 file changed, 5 insertions(+)
5f720ea
5f720ea
diff --git a/src/calibre/test_build.py b/src/calibre/test_build.py
5f720ea
index c17a5ef785..7514d05046 100644
5f720ea
--- a/src/calibre/test_build.py
5f720ea
+++ b/src/calibre/test_build.py
5f720ea
@@ -17,6 +17,10 @@
5f720ea
 
5f720ea
 is_ci = os.environ.get('CI', '').lower() == 'true'
5f720ea
 
5f720ea
+try:
5f720ea
+    import unrardll
5f720ea
+except ModuleNotFoundError:
5f720ea
+    unrardll = None
5f720ea
 
5f720ea
 class BuildTest(unittest.TestCase):
5f720ea
 
5f720ea
@@ -236,6 +240,7 @@ def test_file_dialog_helper(self):
5f720ea
         from calibre.gui2.win_file_dialogs import test
5f720ea
         test()
5f720ea
 
5f720ea
+    @unittest.skipUnless(unrardll, 'Module unrardll is missing')
5f720ea
     def test_unrar(self):
5f720ea
         from calibre.utils.unrar import test_basic
5f720ea
         test_basic()