jeudi 24 novembre 2016

Python instance spying

I have a test stub, and I would like to inspect how its methods are called. This works fine with the mock framework's wraps:

instance = TestStub()
spied = mock.Mock(wraps=instance)

But the problem is that I can't fail the test if an unexpected unwrapped method is called.

Is there a simple way to do that?

Aucun commentaire:

Enregistrer un commentaire