summaryrefslogtreecommitdiff
path: root/doc/en/assert.rst
diff options
context:
space:
mode:
authorpalaviv <palaviv@gmail.com>2016-06-19 23:34:42 +0300
committerpalaviv <palaviv@gmail.com>2016-06-19 23:34:42 +0300
commitc29130d400452107fa68cf2c40a1b47349c27ca0 (patch)
treeed230926ba2cc6a09a23f366867e4f7a45fdd3d1 /doc/en/assert.rst
parentca093673fb8508c4dc7772e71b783ac62b6d5726 (diff)
downloadpytest-c29130d400452107fa68cf2c40a1b47349c27ca0.tar.gz
Updated documentation
Diffstat (limited to 'doc/en/assert.rst')
-rw-r--r--doc/en/assert.rst7
1 files changed, 7 insertions, 0 deletions
diff --git a/doc/en/assert.rst b/doc/en/assert.rst
index 680d22798..687dadb85 100644
--- a/doc/en/assert.rst
+++ b/doc/en/assert.rst
@@ -85,6 +85,13 @@ and if you need to have access to the actual exception info you may use::
the actual exception raised. The main attributes of interest are
``.type``, ``.value`` and ``.traceback``.
+In the context manager form you may use the keyword argument
+``message`` to specify a custom failure message::
+
+ >>> with raises(ZeroDivisionError, message="Expecting ZeroDivisionError"):
+ ... pass
+ ... Failed: Expecting ZeroDivisionError
+
If you want to write test code that works on Python 2.4 as well,
you may also use two other ways to test for an expected exception::