From 778cba7f29d26d44404bacd926480d8049e454d3 Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Tue, 30 Jul 2013 22:31:06 -0400 Subject: [PATCH] Issue #18573: More copy-paste fixes to assertWarns entry. --- Doc/library/unittest.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index 7671f653faf..845bf0a2958 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -897,12 +897,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): @@ -915,7 +915,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()