Overview of pytest-mock features
mainThe pytest-mock plugin enhances pytest testing workflows by providing the mocker fixture. Key features include:
- Automatic Cleanup: All mocks created via the
mockerfixture are automatically undone after the test completes. - Patching API: A thin wrapper around the standard
mocklibrary's patching capabilities. - Spying and Stubbing: Provides utilities like
spyandstubfor observing or replacing behavior. - Pytest Introspection: Uses
pytestintrospection when comparing calls to improve error reporting and accuracy.