Open GoogleCodeExporter opened 9 years ago
There's also:
self.assertNotIn(call(1, 2, 3), mock.mock_calls)
Original comment by fuzzyman
on 17 May 2012 at 12:02
The workaround is
self.assertFalse(mock.called)
but something like think looks much better:
mock.assert_not_called()
or event better for PEP8 joy:
mock.assertNotCalled()
Thanks!
Original comment by adiroi...@gmail.com
on 4 Jul 2013 at 12:37
Also useful for generating a helpful message (rather than "True is not False"
or having to write your own).
Patch here:
https://code.google.com/r/helen-mock/source/detail?r=75c2da89197361589e9b4e2a35b
a84aba68eb1c7&name=assert_not_called
I've also put in an assert_called function. i.e. the mock was called, there
might have been args but the test doesn't care what they are.
Original comment by he...@rrdlabs.co.uk
on 25 Aug 2014 at 12:30
Original issue reported on code.google.com by
wich...@wiggy.net
on 17 May 2012 at 12:00