From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 17 Jul 2018 05:18:56 +0000 (-0700) Subject: bpo-33967: Fix wrong use of assertRaises (GH-8306) X-Git-Tag: v3.7.1rc1~270 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=892df9d15aae08d4033faeb34698e3c550c85854;p=thirdparty%2FPython%2Fcpython.git bpo-33967: Fix wrong use of assertRaises (GH-8306) (cherry picked from commit 56d8f57b83a37b05a6f2fbc3e141bbc1ba6cb3a2) Co-authored-by: INADA Naoki --- diff --git a/Lib/test/test_functools.py b/Lib/test/test_functools.py index 93f2800a3c70..7a0757f7e17b 100644 --- a/Lib/test/test_functools.py +++ b/Lib/test/test_functools.py @@ -2192,7 +2192,7 @@ class TestSingleDispatch(unittest.TestCase): def f(*args): pass msg = 'f requires at least 1 positional argument' - with self.assertRaises(TypeError, msg=msg): + with self.assertRaisesRegex(TypeError, msg): f() if __name__ == '__main__':