[New-bugs-announce] [issue28380] Mock functions with autospec don't support assert_called_once, assert_called, assert_not_called

Yannick Brehon report at bugs.python.org
Thu Oct 6 16:13:19 EDT 2016


New submission from Yannick Brehon:

If one defines a mock for a function, using autospec=True, then the mock will correctly support assert_called_once_with(), among others, but not assert_called_once, assert_called, and assert_not_called.
The attached file contains a fix for the issue.

----------
components: Library (Lib)
files: fix_autospecced_mock_functions.patch
keywords: patch
messages: 278208
nosy: Yannick Brehon
priority: normal
severity: normal
status: open
title: Mock functions with autospec don't support assert_called_once, assert_called, assert_not_called
type: behavior
versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file44991/fix_autospecced_mock_functions.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28380>
_______________________________________


More information about the New-bugs-announce mailing list