Blame SOURCES/Make-webtest-an-optional-dependency.patch

68b28b
From 2164f10fe5d992006f42c4a8d682f23b04ffbf12 Mon Sep 17 00:00:00 2001
68b28b
From: Robbie Harwood <rharwood@redhat.com>
68b28b
Date: Thu, 9 Aug 2018 14:57:56 -0400
68b28b
Subject: [PATCH] Make webtest an optional dependency
68b28b
68b28b
Resolves: #38
68b28b
(cherry picked from commit c0bee88c60deb176d420d90447d24c370d70727a)
68b28b
---
68b28b
 tests.py | 7 ++++++-
68b28b
 1 file changed, 6 insertions(+), 1 deletion(-)
68b28b
68b28b
diff --git a/tests.py b/tests.py
68b28b
index 992529f..c2b1fc0 100644
68b28b
--- a/tests.py
68b28b
+++ b/tests.py
68b28b
@@ -33,7 +33,11 @@ from dns.rdataclass import IN as RDCLASS_IN
68b28b
 from dns.rdatatype import SRV as RDTYPE_SRV
68b28b
 from dns.rdtypes.IN.SRV import SRV
68b28b
 
68b28b
-from webtest import TestApp as WebTestApp
68b28b
+try:
68b28b
+    from webtest import TestApp as WebTestApp
68b28b
+except ImportError:
68b28b
+    print("webtest not installed!  Tests will be skipped")
68b28b
+    WebTestApp = "skip"
68b28b
 
68b28b
 import kdcproxy
68b28b
 from kdcproxy import codec
68b28b
@@ -45,6 +49,7 @@ HERE = os.path.dirname(os.path.abspath(__file__))
68b28b
 KRB5_CONFIG = os.path.join(HERE, 'tests.krb5.conf')
68b28b
 
68b28b
 
68b28b
+@unittest.skipIf(WebTestApp == "skip", "webtest not installed")
68b28b
 class KDCProxyWSGITests(unittest.TestCase):
68b28b
     addrinfo = [
68b28b
         (2, 1, 6, '', ('128.66.0.2', 88)),