mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
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>
This commit is contained in:
parent
80e387adfa
commit
7cb7d4b53e
@ -26,19 +26,16 @@ from samba.samdb import SamDB
|
|||||||
from samba import credentials
|
from samba import credentials
|
||||||
import subprocess
|
import subprocess
|
||||||
import tempfile
|
import tempfile
|
||||||
|
import unittest
|
||||||
|
|
||||||
samba.ensure_external_module("mimeparse", "mimeparse")
|
try:
|
||||||
samba.ensure_external_module("extras", "extras")
|
from unittest import SkipTest as TestSkipped
|
||||||
samba.ensure_external_module("testtools", "testtools")
|
except ImportError:
|
||||||
|
class TestSkipped(Exception):
|
||||||
# Other modules import these two classes from here, for convenience:
|
"""Test skipped."""
|
||||||
from testtools.testcase import (
|
|
||||||
TestCase as TesttoolsTestCase,
|
|
||||||
TestSkipped,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class TestCase(TesttoolsTestCase):
|
class TestCase(unittest.TestCase):
|
||||||
"""A Samba test case."""
|
"""A Samba test case."""
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
@ -57,7 +54,7 @@ class TestCase(TesttoolsTestCase):
|
|||||||
return cmdline_credentials
|
return cmdline_credentials
|
||||||
|
|
||||||
|
|
||||||
class LdbTestCase(TesttoolsTestCase):
|
class LdbTestCase(unittest.TestCase):
|
||||||
"""Trivial test case for running tests against a LDB."""
|
"""Trivial test case for running tests against a LDB."""
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user