Debian Codegraph @

tests/test_issue65.py

raw
1 import pickle
2
3 from tblib import pickling_support
4
5
6 class HTTPrettyError(Exception):
7 pass
8
9
10 class UnmockedError(HTTPrettyError):
11 def __init__(self):
12 super().__init__('No mocking was registered, and real connections are not allowed (httpretty.allow_net_connect = False).')
13
14
15 def test_65():
16 pickling_support.install()
17
18 try:
19 raise UnmockedError
20 except Exception as e:
21 exc = e
22
23 exc = pickle.loads(pickle.dumps(exc))
24
25 assert isinstance(exc, UnmockedError)
26 assert exc.args == ('No mocking was registered, and real connections are not allowed (httpretty.allow_net_connect = False).',)
27 assert exc.__traceback__ is not None