diff --git a/Lib/test/test_functools.py b/Lib/test/test_functools.py index 5e454dd9abc297..86ed9d52e1b4b6 100644 --- a/Lib/test/test_functools.py +++ b/Lib/test/test_functools.py @@ -2083,7 +2083,7 @@ def test_invalid_positional_argument(self): def f(*args): pass msg = 'f requires at least 1 positional argument' - with self.assertRaisesRegexp(TypeError, msg): + with self.assertRaises(TypeError, msg=msg): f() if __name__ == '__main__':