[docs] [issue24653] Mock.assert_has_calls() is surprising for users
report at bugs.python.org
Sun May 19 23:36:04 EDT 2019
Inada Naoki <songofacandy at gmail.com> added the comment:
I concur with Serhiy. Current document and example describe clearly
that this API is for checking inclusion, not equality.
>>> mock = Mock(return_value=None)
>>> calls = [call(2), call(3)]
>>> calls = [call(4), call(2), call(3)]
>>> mock.assert_has_calls(calls, any_order=True)
Empty list is allowed by same rule. There are no exception.
And when people understand this API checks inclusion, calling with
empty list doesn't make sense at all. So I don't think it is worth enough.
resolution: -> wont fix
stage: patch review -> resolved
status: open -> closed
Python tracker <report at bugs.python.org>
More information about the docs