Avoid importing TestCase and TestSkipped from testtools.
authorJelmer Vernooij <jelmer@samba.org>
Sun, 14 Dec 2014 19:59:13 +0000 (19:59 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 6 Mar 2015 03:41:47 +0000 (04:41 +0100)
Change-Id: I34488ddf253decd336a67a8634e7039096bdd160
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/tests/__init__.py

index 5b45865a815cbc44335acc8f54b437281cc7c979..dc6a247cca637421e060c5e04f220ff72afefe25 100644 (file)
@@ -26,19 +26,16 @@ from samba.samdb import SamDB
 from samba import credentials
 import subprocess
 import tempfile
+import unittest
 
-samba.ensure_external_module("mimeparse", "mimeparse")
-samba.ensure_external_module("extras", "extras")
-samba.ensure_external_module("testtools", "testtools")
+try:
+    from unittest import SkipTest as TestSkipped
+except ImportError:
+    class TestSkipped(Exception):
+        """Test skipped."""
 
-# Other modules import these two classes from here, for convenience:
-from testtools.testcase import (
-    TestCase as TesttoolsTestCase,
-    TestSkipped,
-    )
 
-
-class TestCase(TesttoolsTestCase):
+class TestCase(unittest.TestCase):
     """A Samba test case."""
 
     def setUp(self):
@@ -57,7 +54,7 @@ class TestCase(TesttoolsTestCase):
         return cmdline_credentials
 
 
-class LdbTestCase(TesttoolsTestCase):
+class LdbTestCase(unittest.TestCase):
     """Trivial test case for running tests against a LDB."""
 
     def setUp(self):