diff --git a/python/samba/tests/__init__.py b/python/samba/tests/__init__.py index 25de135a990..d85260c3066 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 3206a27e678..407a9d52a73 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",