TODO and LimitationsΒΆ

Contributions, bug reports and comments welcomed!

When mocking a class with patch, passing in spec=True, the mock class has an instance created from the same spec. Should this be the default behaviour for mocks anyway (mock return values inheriting the spec from their parent), or should it be controlled by an additional keyword argument (inherit) to the Mock constructor?


Could take a patch keyword argument and auto-do the patching in the constructor and unpatch in the destructor. This would be useful in itself, but violates TOOWTDI and would be unsafe for IronPython (non-deterministic calling of destructors).

Mock has several attributes. This makes it unsuitable for mocking objects that use these attribute names. A way round this would be to provide start and stop (or similar) methods that hide these attributes when needed.

Previous topic


Next topic


This Page