[pypy-commit] pypy py3.6: be less strict about error message

cfbolz pypy.commits at gmail.com
Mon May 21 10:35:57 EDT 2018


Author: Carl Friedrich Bolz-Tereick <cfbolz at gmx.de>
Branch: py3.6
Changeset: r94643:1f88315814dc
Date: 2018-05-21 16:34 +0200
http://bitbucket.org/pypy/pypy/changeset/1f88315814dc/

Log:	be less strict about error message

diff --git a/lib-python/3/test/test_types.py b/lib-python/3/test/test_types.py
--- a/lib-python/3/test/test_types.py
+++ b/lib-python/3/test/test_types.py
@@ -1004,7 +1004,7 @@
             X = types.new_class("X", (int(), C))
 
     def test_one_argument_type(self):
-        expected_message = 'type.__new__() takes exactly 3 arguments (1 given)'
+        expected_message = '.__new__() takes exactly 3 arguments (1 given)'
 
         # Only type itself can use the one-argument form (#27157)
         self.assertIs(type(5), int)
@@ -1013,13 +1013,13 @@
             pass
         with self.assertRaises(TypeError) as cm:
             M(5)
-        self.assertEqual(str(cm.exception), expected_message)
+        self.assertIn(expected_message, str(cm.exception))
 
         class N(type, metaclass=M):
             pass
         with self.assertRaises(TypeError) as cm:
             N(5)
-        self.assertEqual(str(cm.exception), expected_message)
+        self.assertIn(expected_message, str(cm.exception))
 
 
 class SimpleNamespaceTests(unittest.TestCase):


More information about the pypy-commit mailing list