[New-bugs-announce] [issue21478] mock calls don't propagate to parent (autospec)
report at bugs.python.org
Mon May 12 14:56:34 CEST 2014
New submission from Dmitry Andreychuk:
Calls to autospecced mock functions are not recorded to mock_calls list of parent mock. This only happens if autospec is used and the original object is a function.
import unittest.mock as mock
parent = mock.Mock()
parent.child = mock.create_autospec(foo)
It works fine if foo function is substituted with a class.
Initially I came across this problem with patch() and attach_mock() but I simplified it for the demonstration.
components: Library (Lib)
title: mock calls don't propagate to parent (autospec)
versions: Python 3.3, Python 3.4
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce