diff options
author | Christian Heimes <christian@cheimes.de> | 2013-07-31 11:58:41 +0200 |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2013-07-31 11:58:41 +0200 |
commit | 7cd97fcf6ec35c828920bbbb66d4693d63046b09 (patch) | |
tree | 9b3469465b753b95d11a528aff5ac1eb293e0e92 | |
parent | 6ffa5ce1f3daad9dc7beb5b74444f74d5c4a9538 (diff) | |
parent | 92e2a220ef3d5d8250bbd7aa7e2768ee220c95dd (diff) | |
download | cpython-git-7cd97fcf6ec35c828920bbbb66d4693d63046b09.tar.gz |
merge
-rw-r--r-- | Doc/library/unittest.rst | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index a5c4783682..6c9f2f1868 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -974,12 +974,12 @@ Test cases Test that a warning is triggered when *callable* is called with any positional or keyword arguments that are also passed to :meth:`assertWarns`. The test passes if *warning* is triggered and - fails if it isn't. Also, any unexpected exception is an error. + fails if it isn't. Any exception is an error. To catch any of a group of warnings, a tuple containing the warning classes may be passed as *warnings*. If only the *warning* and possibly the *msg* arguments are given, - returns a context manager so that the code under test can be written + return a context manager so that the code under test can be written inline rather than as a function:: with self.assertWarns(SomeWarning): @@ -992,7 +992,7 @@ Test cases :attr:`warning` attribute, and the source line which triggered the warnings in the :attr:`filename` and :attr:`lineno` attributes. This can be useful if the intention is to perform additional checks - on the exception raised:: + on the warning caught:: with self.assertWarns(SomeWarning) as cm: do_something() |