Hacker News new | ask | show | jobs
by Too 1372 days ago
The MagicMock class from unittest package does what you want.

I have a hard time understanding any use case outside of such mocking.