#6522: add a "decorator" directive to explicitly document decorators, and use it in a few places.
diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst
index f430c17..8449fd2 100644
--- a/Doc/library/unittest.rst
+++ b/Doc/library/unittest.rst
@@ -621,20 +621,20 @@
The following decorators implement test skipping and expected failures:
-.. function:: skip(reason)
+.. decorator:: skip(reason)
Unconditionally skip the decorated test. *reason* should describe why the
test is being skipped.
-.. function:: skipIf(condition, reason)
+.. decorator:: skipIf(condition, reason)
Skip the decorated test if *condition* is true.
-.. function:: skipUnless(condition, reason)
+.. decorator:: skipUnless(condition, reason)
Skip the decoratored test unless *condition* is true.
-.. function:: expectedFailure
+.. decorator:: expectedFailure
Mark the test as an expected failure. If the test fails when run, the test
is not counted as a failure.
@@ -1048,11 +1048,11 @@
:attr:`exception` attribute. This can be useful if the intention
is to perform additional checks on the exception raised::
- with self.assertRaises(SomeException) as cm:
- do_something()
+ with self.assertRaises(SomeException) as cm:
+ do_something()
- the_exception = cm.exception
- self.assertEqual(the_exception.error_code, 3)
+ the_exception = cm.exception
+ self.assertEqual(the_exception.error_code, 3)
.. versionchanged:: 3.1
Added the ability to use :meth:`assertRaises` as a context manager.