[pypy-commit] pypy py3.6: [test_re] After bpo-30978 str.format_map() correctly passes through lookup exceptions

ambv pypy.commits at gmail.com
Tue Feb 5 05:28:34 EST 2019


Author: Łukasz Langa <lukasz at langa.pl>
Branch: py3.6
Changeset: r95798:2d839065d4ea
Date: 2019-02-05 11:27 +0100
http://bitbucket.org/pypy/pypy/changeset/2d839065d4ea/

Log:	[test_re] After bpo-30978 str.format_map() correctly passes through
	lookup exceptions

	It no longer wraps IndexError with the KeyError. This is PyPy
	behavior, too. The test was not updated.

diff --git a/lib-python/3/test/test_re.py b/lib-python/3/test/test_re.py
--- a/lib-python/3/test/test_re.py
+++ b/lib-python/3/test/test_re.py
@@ -473,7 +473,7 @@
             m[(0,)]
         with self.assertRaisesRegex(IndexError, 'no such group'):
             m[(0, 1)]
-        with self.assertRaisesRegex(KeyError, 'a2'):
+        with self.assertRaisesRegex(IndexError, 'no such group'):
             'a1={a2}'.format_map(m)
 
         m = pat.match('ac')


More information about the pypy-commit mailing list