Commit 9c3d6750 authored by Jason R. Coombs's avatar Jason R. Coombs

Add test capturing failure when the Exception is not pickleable. Ref #329.

parent 9948d3c8
...@@ -88,3 +88,15 @@ class TestExceptionSaver: ...@@ -88,3 +88,15 @@ class TestExceptionSaver:
pass pass
saved_exc.resume() saved_exc.resume()
def test_unpickleable_exception(self):
class CantPickleThis(Exception):
"This Exception is unpickleable because it's not in globals"
with setuptools.sandbox.ExceptionSaver() as saved_exc:
raise CantPickleThis('detail')
with pytest.raises(setuptools.sandbox.UnpickleableException) as caught:
saved_exc.resume()
assert str(caught.value) == "CantPickleThis('detail',)"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment