(Just a comment, you can leave this as is.)
Instead of a dedicated class, I usually just create an empty list `cblist=[]` and set `callback=cblist.append`. Then it's easy to check that the callback has been called by checking that `len(cblist) == res['nit']`.