scrapy / scrapy

Scrapy, a fast high-level web crawling & scraping framework for Python.
https://scrapy.org
BSD 3-Clause "New" or "Revised" License
50.99k stars 10.34k forks source link

test_get_func_args() expectation changes in new Python point releases #6312

Closed wRAR closed 2 weeks ago

wRAR commented 3 weeks ago

See https://github.com/scrapy/itemloaders/issues/76

ghost commented 2 weeks ago

Hi @wRAR ,

I'm new to open-source and would love to work on this. Can you point me to what needs to be done?

Gallaecio commented 2 weeks ago

There is a test here that it seems will start failing in newer versions of Python 3.11+. Specifically this line, from what @wRAR described on the linked issue.

@wRAR suggests changing the test expectations to be something like self.assertIn(…, [[], ["obj"]]) (assuming ["obj"] is the new expectation), i.e. assert that the result is either [] or ["obj"].

ghost commented 2 weeks ago

Does this include removing the conditional check (checking for CPython/PyPy) too? If yes, do we remove it entirely, or check only for PyPy?

Gallaecio commented 2 weeks ago

Assuming my guess is correct and the new expectation is ["obj"] as in PyPy, then removing the platform checks altogether makes sense.

Gallaecio commented 2 weeks ago

One thing though: I would keep the URL of the Python issue, for future reference. Maybe just the URL, though, now that it has been fixed in newer versions.

ghost commented 2 weeks ago

I'll push in a change. Thanks!