Fixed #25948 -- Added guidelines for SimpleTestCase.assertRaisesMessage() usage.

This commit is contained in:
Tim Graham 2015-12-22 18:19:29 -05:00
parent 0224f1cb04
commit 77f50c9cfc
2 changed files with 9 additions and 3 deletions

View file

@ -1345,9 +1345,9 @@ your test suite.
Asserts that execution of ``callable`` raises ``expected_exception`` and
that ``expected_message`` is found in the exception's message. Any other
outcome is reported as a failure. Similar to unittest's
:meth:`~unittest.TestCase.assertRaisesRegex` with the difference that
``expected_message`` isn't a regular expression.
outcome is reported as a failure. It's a simpler version of
:meth:`unittest.TestCase.assertRaisesRegex` with the difference that
``expected_message`` isn't treated as a regular expression.
If only the ``expected_exception`` and ``expected_message`` parameters are
given, returns a context manager so that the code being tested can be