Scrapy, a fast high-level web crawling & scraping framework for Python.
Skip tests that don't work on Python 3.12.
Andrey Rakhmatulline058a05763b4
diff --git a/conftest.py b/conftest.pyindex fa5193470..635935748 100644--- a/conftest.py+++ b/conftest.py@@ -87,6 +87,8 @@ def requires_uvloop(request):pytest.skip("uvloop does not support Windows")if twisted_version == Version("twisted", 21, 2, 0):pytest.skip("https://twistedmatrix.com/trac/ticket/10106")+ if sys.version_info >= (3, 12):+ pytest.skip("uvloop doesn't support Python 3.12 yet")def pytest_configure(config):diff --git a/tests/requirements.txt b/tests/requirements.txtindex 618949795..37186f3a7 100644--- a/tests/requirements.txt+++ b/tests/requirements.txt@@ -1,15 +1,17 @@# Tests requirementsattrs-pyftpdlib+# https://github.com/giampaolo/pyftpdlib/issues/560+pyftpdlib; python_version < "3.12"pytestpytest-cov==4.0.0pytest-xdistsybil >= 1.3.0 # https://github.com/cjw296/sybil/issues/20#issuecomment-605433422testfixtures-uvloop; platform_system != "Windows"+# uvloop currently doesn't build on 3.12+uvloop; platform_system != "Windows" and python_version < "3.12"-# optional for shell wrapper tests-bpython+# bpython requires greenlet which currently doesn't build on 3.12+bpython; python_version < "3.12" # optional for shell wrapper testsbrotli # optional for HTTP compress downloader middleware testszstandard; implementation_name != 'pypy' # optional for HTTP compress downloader middleware testsipythondiff --git a/tests/test_feedexport.py b/tests/test_feedexport.pyindex 8df86dbd7..eace59d37 100644--- a/tests/test_feedexport.py+++ b/tests/test_feedexport.py@@ -125,6 +125,9 @@ class FileFeedStorageTest(unittest.TestCase):path.unlink()+ sys.version_info >= (3, 12), reason="pyftpdlib doesn't support Python 3.12 yet"+)class FTPFeedStorageTest(unittest.TestCase):def get_test_spider(self, settings=None):class TestSpider(scrapy.Spider):diff --git a/tests/test_pipeline_files.py b/tests/test_pipeline_files.pyindex 87f3a0295..fe7b26740 100644--- a/tests/test_pipeline_files.py+++ b/tests/test_pipeline_files.py@@ -1,6 +1,7 @@import dataclassesimport osimport random+import sysimport timefrom datetime import datetimefrom io import BytesIO@@ -11,6 +12,7 @@ from unittest import mockfrom urllib.parse import urlparseimport attr+import pytestfrom itemadapter import ItemAdapterfrom twisted.internet import deferfrom twisted.trial import unittest@@ -641,6 +643,9 @@ class TestGCSFilesStore(unittest.TestCase):store.bucket.get_blob.assert_called_with(expected_blob_path)+ sys.version_info >= (3, 12), reason="pyftpdlib doesn't support Python 3.12 yet"+)class TestFTPFileStore(unittest.TestCase):@defer.inlineCallbacksdef test_persist(self):