New submission from John Villalovos <j...@sodarock.com>: 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()) ---------- components: Library (Lib) messages: 304549 nosy: John Villalovos priority: normal severity: normal status: open title: Using autospec=True conflicts with 'wraps' type: behavior versions: Python 3.6 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue31807> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com