MCPcopy
hub / github.com/scrapy/scrapy / nonserializable_object_test

Function nonserializable_object_test

tests/test_squeues.py:32–44  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

30
31
32def nonserializable_object_test(self):
33 q = self.queue()
34 with pytest.raises(
35 ValueError,
36 match=r"unmarshallable object|Can't (get|pickle) local object|Can't pickle .*: it's not found as",
37 ):
38 q.push(lambda x: x)
39 # Selectors should fail (lxml.html.HtmlElement objects can't be pickled)
40 sel = Selector(text="<html><body><p>some text</p></body></html>")
41 with pytest.raises(
42 ValueError, match=r"unmarshallable object|can't pickle Selector objects"
43 ):
44 q.push(sel)
45
46
47class FifoDiskQueueTestMixin:

Callers

nothing calls this directly

Calls 3

SelectorClass · 0.90
queueMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected