Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
>>> Original = Class
>>> patcher = patch('__main__.Class', spec=True)
>>> MockClass = patcher.start()
>>> instance = MockClass()
>>> assert isinstance(instance, Original)
>>> patcher.stop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment