[TIP] autospec and wraps interaction
jchien10 at gmail.com
Wed Nov 18 15:43:37 PST 2015
I get the following behavior with autospec and wraps.
>>> from foo import dummy
>>> p1 = mock.patch('foo.dummy', wraps=dummy)
>>> m1 = z1.start()
<MagicMock name='dummy' id='4429382744'>
>>> p2 = mock.patch('foo.dummy', autospec=True, wraps=dummy)
>>> m2 = p2.start()
<function dummy at 0x1080149b8>
<MagicMock name='dummy()' id='4429216280'>
Is this expected behavior? It seems to me like autospec shouldn't change
the behavior of wraps.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the testing-in-python