This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author John Villalovos
Recipients John Villalovos
Date 2017-10-18.00:48:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1508287695.22.0.213398074469.issue31807@psf.upfronthosting.co.za>
In-reply-to
Content
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())
History
Date User Action Args
2017-10-18 00:48:15John Villalovossetrecipients: + John Villalovos
2017-10-18 00:48:15John Villalovossetmessageid: <1508287695.22.0.213398074469.issue31807@psf.upfronthosting.co.za>
2017-10-18 00:48:15John Villalovoslinkissue31807 messages
2017-10-18 00:48:14John Villalovoscreate