Author: Carl Friedrich Bolz-Tereick <[email protected]>
Branch: py3.5
Changeset: r94382:eccd76eec042
Date: 2018-04-19 12:48 +0200
http://bitbucket.org/pypy/pypy/changeset/eccd76eec042/
Log: fix different error messages (in several cases this brings us closer
to CPython again)
diff --git a/lib-python/3/test/test_exceptions.py
b/lib-python/3/test/test_exceptions.py
--- a/lib-python/3/test/test_exceptions.py
+++ b/lib-python/3/test/test_exceptions.py
@@ -164,10 +164,10 @@
is_pypy = check_impl_detail(pypy=True)
check('def fact(x):\n\treturn x!\n', 2, 10)
- check('1 +\n', 1, 4 - is_pypy)
- check('def spam():\n print(1)\n print(2)', 3, 0 if is_pypy else 10)
- check('Python = "Python" +', 1, 20 - is_pypy)
- check('Python = "\u1e54\xfd\u0163\u0125\xf2\xf1" +', 1, 20 - is_pypy)
+ check('1 +\n', 1, 4)
+ check('def spam():\n print(1)\n print(2)', 3, 2 if is_pypy else 10)
+ check('Python = "Python" +', 1, 20)
+ check('Python = "\u1e54\xfd\u0163\u0125\xf2\xf1" +', 1, 20)
@cpython_only
def testSettingException(self):
diff --git a/lib-python/3/test/test_fstring.py
b/lib-python/3/test/test_fstring.py
--- a/lib-python/3/test/test_fstring.py
+++ b/lib-python/3/test/test_fstring.py
@@ -319,7 +319,7 @@
["f'{3)+(4}'",
])
- self.assertAllRaise(SyntaxError, 'EOL while scanning string literal',
+ self.assertAllRaise(SyntaxError, r'end of line \(EOL\) while scanning
string literal',
["f'{\n}'",
])
@@ -741,7 +741,7 @@
self.assertEqual('{d[0]}'.format(d=d), 'integer')
def test_invalid_expressions(self):
- self.assertAllRaise(SyntaxError, 'invalid syntax',
+ self.assertAllRaise(SyntaxError, "closing parenthesis '.' does not
match opening parenthesis '.'",
[r"f'{a[4)}'",
r"f'{a(4]}'",
])
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit