This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author michael.foord
Recipients berker.peksag, kushal.das, michael.foord, rbcollins
Date 2015-07-20.13:20:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1437398409.65.0.844502867117.issue24653@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2015-07-20 13:20:09michael.foordsetrecipients: + michael.foord, rbcollins, berker.peksag, kushal.das
2015-07-20 13:20:09michael.foordsetmessageid: <1437398409.65.0.844502867117.issue24653@psf.upfronthosting.co.za>
2015-07-20 13:20:09michael.foordlinkissue24653 messages
2015-07-20 13:20:09michael.foordcreate