From 2f5821f5f6cd736f78870b03e51f89aa1583e042 Mon Sep 17 00:00:00 2001 From: Adrian Chaves Date: Fri, 31 Jul 2026 05:16:26 +0200 Subject: [PATCH] Skip min peek() tests --- tests/test_pqueues.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/test_pqueues.py b/tests/test_pqueues.py index b0a804a8e..8ad10e1c6 100644 --- a/tests/test_pqueues.py +++ b/tests/test_pqueues.py @@ -81,6 +81,8 @@ class TestPriorityQueue: remain at a different one must not leave ``curprio`` pointing at a priority that no queue has, which would make ``peek()`` come up empty with requests still queued.""" + if not hasattr(queuelib.queue.FifoMemoryQueue, "peek"): + pytest.skip("queuelib.queue.FifoMemoryQueue.peek is undefined") temp_dir = tempfile.mkdtemp() queue = ScrapyPriorityQueue.from_crawler( self.crawler, @@ -107,6 +109,8 @@ class TestPriorityQueue: """A start request and a non-start request at the same priority sit in separate queues, and ``peek()`` must report the one that ``pop()`` returns, since a caller may peek to decide whether to pop.""" + if not hasattr(queuelib.queue.FifoMemoryQueue, "peek"): + pytest.skip("queuelib.queue.FifoMemoryQueue.peek is undefined") temp_dir = tempfile.mkdtemp() queue = ScrapyPriorityQueue.from_crawler( self.crawler, @@ -129,6 +133,8 @@ class TestPriorityQueue: that fails (e.g. a serialization error) leaves an empty queue behind at that priority. Neither ``peek()`` nor ``pop()`` may let it hide the request that the other dict holds at the same priority.""" + if not hasattr(queuelib.queue.FifoMemoryQueue, "peek"): + pytest.skip("queuelib.queue.FifoMemoryQueue.peek is undefined") temp_dir = tempfile.mkdtemp() queue = ScrapyPriorityQueue.from_crawler( self.crawler,