Author Petter S
Recipients Petter S, eamanu, xtreak
Date 2018-10-24.16:41:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1540399300.96.0.788709270274.issue35047@psf.upfronthosting.co.za>
In-reply-to
Content
Sure, consider the following code:

from unittest import mock

m = mock.Mock()
m(1, 3)
m("Test", data=[42])


When I call

m.assert_not_called()

I get the following error message:

AssertionError: Expected 'mock' to not have been called. Called 2 times.

This is what I would like to improve. On the other hand, if I call

m.assert_has_calls(mock.call(3))

I get the following error:

AssertionError: Calls not found.
Expected: ['', (3,), {}]
Actual: [call(1, 3), call('Test', data=[42])]

This is great and may serve as a template for what I want to introduce.
History
Date User Action Args
2018-10-24 16:41:40Petter Ssetrecipients: + Petter S, eamanu, xtreak
2018-10-24 16:41:40Petter Ssetmessageid: <1540399300.96.0.788709270274.issue35047@psf.upfronthosting.co.za>
2018-10-24 16:41:40Petter Slinkissue35047 messages
2018-10-24 16:41:40Petter Screate