Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

Fix test expectations (#6316)

kokobharab1fe97dc6c85
diff --git a/tests/test_utils_python.py b/tests/test_utils_python.py
index 1d1d19146..4c60deafe 100644
--- a/tests/test_utils_python.py
+++ b/tests/test_utils_python.py
@@ -239,8 +239,11 @@ class UtilsPythonTestCase(unittest.TestCase):
self.assertEqual(get_func_args(" ".join, stripself=True), ["iterable"])
if platform.python_implementation() == "CPython":
- # doesn't work on CPython: https://bugs.python.org/issue42785
- self.assertEqual(get_func_args(operator.itemgetter(2)), [])
+ # This didn't work on older versions of CPython: https://github.com/python/cpython/issues/86951
+ self.assertIn(
+ get_func_args(operator.itemgetter(2), stripself=True),
+ [[], ["args", "kwargs"]],
+ )
elif platform.python_implementation() == "PyPy":
self.assertEqual(
get_func_args(operator.itemgetter(2), stripself=True), ["obj"]