[Python-checkins] [3.7] Make it clear that the msg argument to assertWarns/assertWarnsRegex/assertRaisesRegex is keyword-only. (GH-9680) (GH-9681)
Ned Deily
webhook-mailer at python.org
Fri Oct 5 22:39:50 EDT 2018
https://github.com/python/cpython/commit/2fcaaaca520670123224b6e84068f5e453c04f07
commit: 2fcaaaca520670123224b6e84068f5e453c04f07
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: Ned Deily <nad at python.org>
date: 2018-10-05T22:39:47-04:00
summary:
[3.7] Make it clear that the msg argument to assertWarns/assertWarnsRegex/assertRaisesRegex is keyword-only. (GH-9680) (GH-9681)
A follow up to be4e5b89204283a62e369439025f00362d0424f6.
(cherry picked from commit e006b39a40e0cd6a90c68f1107853ea2ed0ed54d)
Co-authored-by: Benjamin Peterson <benjamin at python.org>
files:
M Doc/library/unittest.rst
diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst
index da8ce4082043..83aee1b02621 100644
--- a/Doc/library/unittest.rst
+++ b/Doc/library/unittest.rst
@@ -984,7 +984,7 @@ Test cases
.. method:: assertRaisesRegex(exception, regex, callable, *args, **kwds)
- assertRaisesRegex(exception, regex, msg=None)
+ assertRaisesRegex(exception, regex, *, msg=None)
Like :meth:`assertRaises` but also tests that *regex* matches
on the string representation of the raised exception. *regex* may be
@@ -1010,7 +1010,7 @@ Test cases
.. method:: assertWarns(warning, callable, *args, **kwds)
- assertWarns(warning, msg=None)
+ assertWarns(warning, *, msg=None)
Test that a warning is triggered when *callable* is called with any
positional or keyword arguments that are also passed to
@@ -1051,7 +1051,7 @@ Test cases
.. method:: assertWarnsRegex(warning, regex, callable, *args, **kwds)
- assertWarnsRegex(warning, regex, msg=None)
+ assertWarnsRegex(warning, regex, *, msg=None)
Like :meth:`assertWarns` but also tests that *regex* matches on the
message of the triggered warning. *regex* may be a regular expression
More information about the Python-checkins
mailing list