[PATCH 43/55] Fix use of TestCase.skipTest on python2.6 now that we no longer use testtools.

Jelmer Vernooij jelmer at samba.org
Fri Feb 6 12:04:15 MST 2015


Change-Id: I630e4073bf1553dfc77e9fe7e843ee8b71907683
Signed-off-by: Jelmer Vernooij <jelmer at samba.org>
---
 python/samba/tests/__init__.py      | 4 ++++
 python/samba/tests/dcerpc/srvsvc.py | 6 +++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/python/samba/tests/__init__.py b/python/samba/tests/__init__.py
index 25de135..d85260c 100644
--- a/python/samba/tests/__init__.py
+++ b/python/samba/tests/__init__.py
@@ -53,6 +53,10 @@ class TestCase(unittest.TestCase):
     def get_credentials(self):
         return cmdline_credentials
 
+    if not getattr(unittest.TestCase, "skipTest", None):
+        def skipTest(self, reason):
+            raise SkipTest(reason)
+
 
 class LdbTestCase(unittest.TestCase):
     """Trivial test case for running tests against a LDB."""
diff --git a/python/samba/tests/dcerpc/srvsvc.py b/python/samba/tests/dcerpc/srvsvc.py
index 3206a27..407a9d5 100644
--- a/python/samba/tests/dcerpc/srvsvc.py
+++ b/python/samba/tests/dcerpc/srvsvc.py
@@ -45,12 +45,12 @@ class SrvsvcTests(RpcInterfaceTestCase):
         return share
 
     def test_NetShareAdd(self):
-        self.skip("Dangerous test")
+        self.skipTest("Dangerous test")
         share = self.getDummyShareObject()
         self.conn.NetShareAdd(self.server_unc, 2, share, None)
 
     def test_NetShareSetInfo(self):
-        self.skip("Dangerous test")
+        self.skipTest("Dangerous test")
         share = self.getDummyShareObject()
         parm_error = 0x00000000
         self.conn.NetShareAdd(self.server_unc, 502, share, parm_error)
@@ -60,7 +60,7 @@ class SrvsvcTests(RpcInterfaceTestCase):
                 502, share, parm_error)
 
     def test_NetShareDel(self):
-        self.skip("Dangerous test")
+        self.skipTest("Dangerous test")
         share = self.getDummyShareObject()
         parm_error = 0x00000000
         self.expectFailure("NetShareAdd doesn't work properly from Python",
-- 
2.1.4



More information about the samba-technical mailing list