How to check for mock calls with wildcards?

I finally found out how to do what I want. Basically, when using assert_has_calls, I wanted one parameter to match regardless of what it was (because I can’t recreate the lambda every time during test).

The way to do it is to use mock.ANY.

So, in my example, this could match the call:

mocked_object.assert_has_calls([
   call('mock', 'foobar', mock.ANY, 10)
])

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)