Skip to content

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

Fix WindowsRunSpiderCommandTest skip outside Windows for older Twisted.

Adrián Chavesab5ea32ffd9c
diff --git a/tests/test_commands.py b/tests/test_commands.py
index febad21da..ff308c5ac 100644
--- a/tests/test_commands.py
+++ b/tests/test_commands.py
@@ -987,10 +987,14 @@ class MySpider(scrapy.Spider):
self.assertIn("The value of FOO is 42", log)
-@skipIf(platform.system() != "Windows", "Windows required for .pyw files")
class WindowsRunSpiderCommandTest(RunSpiderCommandTest):
spider_filename = "myspider.pyw"
+ def setUp(self):
+ # https://github.com/scrapy/scrapy/issues/6286
+ if platform.system() != "Windows":
+ raise unittest.SkipTest("Windows required for .pyw files")
+
def test_start_requests_errors(self):
log = self.get_log(self.badspider, name="badspider.pyw")
self.assertIn("start_requests", log)