diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2014-12-14 19:59:13 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2015-03-06 04:41:47 +0100 |
commit | 7cb7d4b53eec0bea355a94388bfcce320b36ddfc (patch) | |
tree | 2a050f9e141a92d4cb131b0dc7f7ba94bf2e2e9a | |
parent | 80e387adfac7a67ce91a87c656bfc5eded132c6d (diff) | |
download | samba-7cb7d4b53eec0bea355a94388bfcce320b36ddfc.tar.gz samba-7cb7d4b53eec0bea355a94388bfcce320b36ddfc.tar.xz samba-7cb7d4b53eec0bea355a94388bfcce320b36ddfc.zip |
Avoid importing TestCase and TestSkipped from testtools.
Change-Id: I34488ddf253decd336a67a8634e7039096bdd160
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
-rw-r--r-- | python/samba/tests/__init__.py | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/python/samba/tests/__init__.py b/python/samba/tests/__init__.py index 5b45865a81..dc6a247cca 100644 --- a/python/samba/tests/__init__.py +++ b/python/samba/tests/__init__.py @@ -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): |