Message304549
If have autospec=True, then no ValueError is raised. If autospec=False or not defined, then the ValueError is raised.
import sys
from unittest import mock
def wrapped_func(value):
raise ValueError(value)
@mock.patch('__main__.wrapped_func', autospec=True, wraps=wrapped_func)
def main(mock_wrap):
wrapped_func("testing")
if '__main__' == __name__:
sys.exit(main()) |
|
Date |
User |
Action |
Args |
2017-10-18 00:48:15 | John Villalovos | set | recipients:
+ John Villalovos |
2017-10-18 00:48:15 | John Villalovos | set | messageid: <1508287695.22.0.213398074469.issue31807@psf.upfronthosting.co.za> |
2017-10-18 00:48:15 | John Villalovos | link | issue31807 messages |
2017-10-18 00:48:14 | John Villalovos | create | |
|