diff -r 4e6c46d5f77d Doc/library/unittest.rst --- a/Doc/library/unittest.rst Tue Mar 05 02:24:03 2013 -0800 +++ b/Doc/library/unittest.rst Tue Mar 05 15:08:51 2013 -0600 @@ -1896,6 +1896,25 @@ return standard_tests +Skipping tests +~~~~~~~~~~~~~~ + +.. exception:: SkipTest(reason) + + Raise this exception in a test to skip it. + + Usually you can use :meth:`TestResult.skip()` or one of the :ref:`skipping + decorators ` instead of raising this directly. + +Note that this exception can be raised at any time during the execution of a +test to skip the test, including after successful assertions. In such cases, +the assertions before raising :exc:`SkipTest` are not very effective, as the +entire test will be marked as skipped. Thus, best practice is to raise +:exc:`SkipTest` before any actual testing is done. + +.. versionadded:: 2.7 + + Class and Module Fixtures ------------------------- @@ -1956,7 +1975,7 @@ If an exception is raised during a ``setUpClass`` then the tests in the class are not run and the ``tearDownClass`` is not run. Skipped classes will not have ``setUpClass`` or ``tearDownClass`` run. If the exception is a -``SkipTest`` exception then the class will be reported as having been skipped +:exc:`SkipTest` exception then the class will be reported as having been skipped instead of as an error. @@ -1973,7 +1992,7 @@ If an exception is raised in a ``setUpModule`` then none of the tests in the module will be run and the ``tearDownModule`` will not be run. If the exception is a -``SkipTest`` exception then the module will be reported as having been skipped +:exc:`SkipTest` exception then the module will be reported as having been skipped instead of as an error.