Petter S <petter.strandm...@gmail.com> added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35047>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to