#27364: fix "incorrect" uses of escape character in the stdlib.

And most of the tools.

Patch by Emanual Barry, reviewed by me, Serhiy Storchaka, and
Martin Panter.
This commit is contained in:
R David Murray 2016-09-08 13:59:53 -04:00
parent 513d7478a1
commit 44b548dda8
83 changed files with 324 additions and 324 deletions

View file

@ -625,20 +625,20 @@ class KeywordOnly_TestCase(unittest.TestCase):
)
# required arg missing
with self.assertRaisesRegex(TypeError,
"Required argument 'required' \(pos 1\) not found"):
r"Required argument 'required' \(pos 1\) not found"):
getargs_keyword_only(optional=2)
with self.assertRaisesRegex(TypeError,
"Required argument 'required' \(pos 1\) not found"):
r"Required argument 'required' \(pos 1\) not found"):
getargs_keyword_only(keyword_only=3)
def test_too_many_args(self):
with self.assertRaisesRegex(TypeError,
"Function takes at most 2 positional arguments \(3 given\)"):
r"Function takes at most 2 positional arguments \(3 given\)"):
getargs_keyword_only(1, 2, 3)
with self.assertRaisesRegex(TypeError,
"function takes at most 3 arguments \(4 given\)"):
r"function takes at most 3 arguments \(4 given\)"):
getargs_keyword_only(1, 2, 3, keyword_only=5)
def test_invalid_keyword(self):
@ -673,11 +673,11 @@ class PositionalOnlyAndKeywords_TestCase(unittest.TestCase):
self.assertEqual(self.getargs(1), (1, -1, -1))
# required positional arg missing
with self.assertRaisesRegex(TypeError,
"Function takes at least 1 positional arguments \(0 given\)"):
r"Function takes at least 1 positional arguments \(0 given\)"):
self.getargs()
with self.assertRaisesRegex(TypeError,
"Function takes at least 1 positional arguments \(0 given\)"):
r"Function takes at least 1 positional arguments \(0 given\)"):
self.getargs(keyword=3)
def test_empty_keyword(self):