[docs] [issue28911] Clarify the behaviour of assert_called_once_with

Arne de Laat report at bugs.python.org
Thu Jan 19 08:04:56 EST 2017


Arne de Laat added the comment:

Unfortunately there cant be commas in the method name, that would clarify the name. It should be read as 'assert called once, with ...' not 'assert called once with ...'.

I have often used the method to test something was called only once, and with the specified arguments.

It seems that it is more difficult (i.e. no single method) to check if only one call was made with the specified arguments (allowing for more calls with other arguments), perhaps that could be added. Something like 'assert_once_called_with' or 'assert_one_call_with'.

----------
nosy: +153957

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


More information about the docs mailing list