[issue31807] Using autospec=True conflicts with 'wraps'

2017-10-17 Thread John Villalovos

New submission from John Villalovos :

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 
<https://bugs.python.org/issue31807>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31807] unitest.mock: Using autospec=True conflicts with 'wraps'

2017-10-17 Thread John Villalovos

Change by John Villalovos :


--
title: Using autospec=True conflicts with 'wraps' -> unitest.mock: Using 
autospec=True conflicts with 'wraps'

___
Python tracker 
<https://bugs.python.org/issue31807>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com