instance.
- .. method:: skip(reason)
+ .. method:: skipTest(reason)
Calling this during the a test method or :meth:`setUp` skips the current
test. See :ref:`unittest-skipping` for more information.
def test_skipping(self):
class Foo(unittest.TestCase):
def test_skip_me(self):
- self.skip("skip")
+ self.skipTest("skip")
events = []
result = LoggingResult(events)
test = Foo("test_skip_me")
# Try letting setUp skip the test now.
class Foo(unittest.TestCase):
def setUp(self):
- self.skip("testing")
+ self.skipTest("testing")
def test_nothing(self): pass
events = []
result = LoggingResult(events)
getattr(self, self._testMethodName)()
self.tearDown()
- def skip(self, reason):
+ def skipTest(self, reason):
"""Skip this test."""
raise SkipTest(reason)