Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >>> with mock.patch('__main__.foo', side_effect=[1,Exception()]) as f:
- ... f(1)
- ... f(2)
- ...
- 1
- Traceback (most recent call last):
- File "<stdin>", line 3, in <module>
- File "/home/dan/nova/.tox/py27/lib/python2.7/site-packages/mock/mock.py", line 1092, in __call__
- return _mock_self._mock_call(*args, **kwargs)
- File "/home/dan/nova/.tox/py27/lib/python2.7/site-packages/mock/mock.py", line 1147, in _mock_call
- raise result
- Exception
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement