diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index 9e8a246..c91ebf4 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -985,14 +985,14 @@ Test cases with self.assertWarns(SomeWarning): do_something() - When used as a context manager, :meth:`assertRaises` accepts the + When used as a context manager, :meth:`assertWarns` accepts the additional keyword argument *msg*. The context manager will store the caught warning object in its :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 triggered:: with self.assertWarns(SomeWarning) as cm: do_something()