[docs] [issue24653] Mock.assert_has_calls([]) is surprising for users

Éric Araujo report at bugs.python.org
Tue May 21 15:01:59 EDT 2019

Éric Araujo <merwok at netwok.org> added the comment:

> And when people understand this API checks inclusion, calling with
empty list doesn't make sense at all. 

I can see a thought process being «all my other tests use thing.assert_has_calls([call0, call1]), here let’s check there are no calls with thing2.assert_has_calls([])».

Are the correct methods advertised in the right place?  (I don’t use mock so I forgot if there is a method to assert not called or if it’s assertEqual(mock calls count, 0) or some False property)

nosy: +eric.araujo

Python tracker <report at bugs.python.org>

More information about the docs mailing list