1
0
mirror of https://github.com/scrapy/scrapy.git synced 2025-02-24 04:04:13 +00:00

Fix get_func_args test for pypy3

These built-in functions are exposed as methods in PyPy3.
For scrapy this does not matter as:
1) they do not work for CPython at all
2) get_func_args is checked for presense of an argument in scrapy,
   extra "self" does not matter.
But it still makes sense to leave these tests so that we know we
shouldn't use get_func_args for built-in functions/methods.
This commit is contained in:
Konstantin Lopuhin 2017-12-25 14:27:20 +03:00
parent f71df6f9ad
commit 041308afe7

View File

@ -219,9 +219,12 @@ class UtilsPythonTestCase(unittest.TestCase):
self.assertEqual(get_func_args(" ".join), [])
self.assertEqual(get_func_args(operator.itemgetter(2)), [])
else:
self.assertEqual(get_func_args(six.text_type.split), ['sep', 'maxsplit'])
self.assertEqual(get_func_args(" ".join), ['list'])
self.assertEqual(get_func_args(operator.itemgetter(2)), ['obj'])
stripself = not six.PY2 # PyPy3 exposes them as methods
self.assertEqual(
get_func_args(six.text_type.split, stripself), ['sep', 'maxsplit'])
self.assertEqual(get_func_args(" ".join, stripself), ['list'])
self.assertEqual(
get_func_args(operator.itemgetter(2), stripself), ['obj'])
def test_without_none_values(self):