[issue30949] Provide assertion functions in unittest.mock

ppperry report at bugs.python.org
Mon Jul 17 16:29:52 EDT 2017


ppperry added the comment:

You can already do this, although it it somewhat of a hack:

>>> assert_called_once=Mock.assert_called_once # This will be an AttributeError
>>> assert_called_once_with=Mock.assert_called_once_with
>>> example = Mock()
>>> assert_caled_once_with(example, ...)  # A NameError
>>> assert_called_once_with(example, ...)  # Great success!

----------
nosy: +ppperry

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


More information about the Python-bugs-list mailing list