How can I easily create an object that cannot be pickled for testing edge cases in my rpc code?
It needs to be:
- Simple
- Reliable (not expected to break in future versions of python or pickle)
- Cross platform
Edit: The intended use looks something like this:
class TestRPCServer:
def foo(self):
return MagicalUnpicklableObject()
def test():
with run_rpc_server_and_connect_to_it() as proxy:
with nose.assert_raises(pickle.PickleError):
proxy.foo()
Aucun commentaire:
Enregistrer un commentaire