[pypy-commit] pypy py3.5: fix the expected exception messages
arigo
pypy.commits at gmail.com
Sat Feb 11 12:38:40 EST 2017
Author: Armin Rigo <arigo at tunes.org>
Branch: py3.5
Changeset: r90055:c7f45f48949e
Date: 2017-02-11 18:38 +0100
http://bitbucket.org/pypy/pypy/changeset/c7f45f48949e/
Log: fix the expected exception messages
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
@@ -1064,8 +1064,9 @@
self.assertIn("<exception str() failed>", report)
else:
# pypy: this is what lib-python's traceback.py gives
- self.assertIn("<unprintable BrokenExceptionDel object>",
- report)
+ self.assertRegex(report,
+ ".*BrokenStrException: <unprintable"
+ " BrokenStrException object>\n")
else:
self.assertIn("ValueError", report)
self.assertIn("del is broken", report)
@@ -1118,7 +1119,8 @@
self.assertEqual(exc.name, 'somename')
self.assertEqual(exc.path, 'somepath')
- msg = "'invalid' is an invalid keyword argument for this function"
+ msg = ("'invalid' is an invalid keyword argument for this function"
+ "|ImportError does not take keyword arguments") # PyPy message
with self.assertRaisesRegex(TypeError, msg):
ImportError('test', invalid='keyword')
@@ -1131,7 +1133,8 @@
with self.assertRaisesRegex(TypeError, msg):
ImportError(invalid='keyword')
- msg = "'invalid|another' is an invalid keyword argument for this function"
+ msg = ("'invalid|another' is an invalid keyword argument for this function"
+ "|ImportError does not take keyword arguments") # PyPy message
with self.assertRaisesRegex(TypeError, msg):
ImportError('test', invalid='keyword', another=True)
More information about the pypy-commit
mailing list