[issue24653] Mock.assert_has_calls([]) is surprising for users

Irit Katriel report at bugs.python.org
Fri Oct 9 12:50:09 EDT 2020


Irit Katriel <iritkatriel at yahoo.com> added the comment:

I agree that the confusion was probably due to assumptions rather than a misreading of the doc, and I would not object to closing this issue.

However, Robert did object so I would like to suggest an adjustment that may help:

Currently the documentation of assert_not_called is just after that of assert_has_calls.   If we reverse their order, then there can be less room for confusion about how to check that nothing was called - you would read that first. 

https://docs.python.org/3/library/unittest.mock.html#unittest.mock.Mock.assert_has_calls

----------
nosy: +iritkatriel
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.4, Python 3.5, Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue24653>
_______________________________________


More information about the Python-bugs-list mailing list