(self)
| 36 | assert not queue.close() |
| 37 | |
| 38 | def test_no_peek_raises(self): |
| 39 | if hasattr(queuelib.queue.FifoMemoryQueue, "peek"): |
| 40 | pytest.skip("queuelib.queue.FifoMemoryQueue.peek is defined") |
| 41 | temp_dir = tempfile.mkdtemp() |
| 42 | queue = ScrapyPriorityQueue.from_crawler( |
| 43 | self.crawler, FifoMemoryQueue, temp_dir |
| 44 | ) |
| 45 | queue.push(Request("https://example.org")) |
| 46 | with pytest.raises( |
| 47 | NotImplementedError, |
| 48 | match="The underlying queue class does not implement 'peek'", |
| 49 | ): |
| 50 | queue.peek() |
| 51 | queue.close() |
| 52 | |
| 53 | def test_peek(self): |
| 54 | if not hasattr(queuelib.queue.FifoMemoryQueue, "peek"): |
nothing calls this directly
no test coverage detected