Plugins ======= So far, we have focused on using :doc:`mock ` directly. However, there are many plugins that can help with mocking, such as `pytest-mock `_, which, amongst other things, provides a ``mocker`` fixture. One advantage is that the fixture cleans up after itself, so you don’t need to use a ``with`` block, as we did in our examples. `mocker.spy `_ is also a handy simplification based on ``wraps`` and ``autospec``. There are also some specialised mocking libraries: - For mocking database access, the following are suitable: - `pytest-postgresql `_ - `pytest-mongo `_ - `pytest-mysql `_ - `pytest-dynamodb `_. - To test HTTP servers, you can use `pytest-httpserver `_. - To mock `requests `_, you can use `responses `_ or `betamax `_. - Other tools for various requirements are - `pytest-rabbitmq `_ - `pytest-solr `_ - `pytest-elasticsearch `_ and `pytest-redis `_.