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

WindowsRunSpiderCommandTest isn't skipped properly in the pinned envs #6286

Closed wRAR closed 1 month ago

wRAR commented 1 month ago

https://github.com/scrapy/scrapy/commit/002513438204eea5062b5a1d75fb4f261880da4f was incorrect as, it turned out, top-level unittest.skipIf support for twisted.trial.unittest tests was added only in Twisted 21.2.0 and we install 18.9.0 in the pinned envs, but for some reason the test was still skipped. Today pytest 8.1.1 was released and the problem is now visible (I don't see anything related in the changelog but then I don't know why the test is skipped in 8.0.2 and earlier), so the test fails on pinned envs on Linux instead of being skipped.

We can revert the linked commit, raise the minimum supported Twisted version to 21.2.0 (it's also the first version officially supporting Python 3.8 which itself was released in Oct 2019, so a year later than Twisted 18.9.0), or add some more complicated code that skips the individual methods only for older Twisted.