mirror of https://github.com/scrapy/scrapy.git
Fix tests for the 3.10 TypeError message change.
This commit is contained in:
parent
ef6fb933b5
commit
93bf1ae7e3
|
|
@ -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'"))
|
||||
|
|
|
|||
|
|
@ -158,12 +158,14 @@ class CallbackKeywordArgumentsTestCase(TestCase):
|
|||
if key in line.getMessage():
|
||||
exceptions[key] = line
|
||||
self.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'"
|
||||
)
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue