Scrapy, a fast high-level web crawling & scraping framework for Python.
Fix tests for the 3.10 TypeError message change.
Andrey Rakhmatullin93bf1ae7e396
diff --git a/tests/test_http_response.py b/tests/test_http_response.pyindex cf34a9e5c..c376a46cd 100644--- a/tests/test_http_response.py+++ b/tests/test_http_response.py@@ -878,4 +878,4 @@ class CustomResponseTest(TextResponseTest):with self.assertRaises(TypeError) as ctx:r1.replace(unknown="unknown")- self.assertEqual(str(ctx.exception), "__init__() got an unexpected keyword argument 'unknown'")+ self.assertTrue(str(ctx.exception).endswith("__init__() got an unexpected keyword argument 'unknown'"))diff --git a/tests/test_request_cb_kwargs.py b/tests/test_request_cb_kwargs.pyindex 145a4e9b2..b68184b87 100644--- a/tests/test_request_cb_kwargs.py+++ b/tests/test_request_cb_kwargs.py@@ -158,12 +158,14 @@ class CallbackKeywordArgumentsTestCase(TestCase):if key in line.getMessage():exceptions[key] = lineself.assertEqual(exceptions['takes_less'].exc_info[0], TypeError)- self.assertEqual(- str(exceptions['takes_less'].exc_info[1]),- "parse_takes_less() got an unexpected keyword argument 'number'"+ self.assertTrue(+ str(exceptions['takes_less'].exc_info[1]).endswith(+ "parse_takes_less() got an unexpected keyword argument 'number'"+ ))self.assertEqual(exceptions['takes_more'].exc_info[0], TypeError)- self.assertEqual(- str(exceptions['takes_more'].exc_info[1]),- "parse_takes_more() missing 1 required positional argument: 'other'"+ self.assertTrue(+ str(exceptions['takes_more'].exc_info[1]).endswith(+ "parse_takes_more() missing 1 required positional argument: 'other'"+ ))