Michael Foord added the comment:
assert_has_calls checks that the calls you specified were made. So if you
specify an empty list it *should* pass (or be disallowed as it has no meaning).
If you want to check that these calls and *only* those calls were made you
should use something like:
self.assertEqual(mock.mock_calls, [])
http://www.voidspace.org.uk/python/mock/mock.html#mock.Mock.assert_has_calls
Maybe a documentation improvement instead.
----------
resolution: -> not a bug
status: open -> closed
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue24653>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com