| 30 | |
| 31 | |
| 32 | def 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 | |
| 47 | class FifoDiskQueueTestMixin: |