The hook-based plugin architecture of py.test
summary
py.test uses a hook-based plugin system split out as the standalone pluggy package that implements extension points as hook specifications (function signatures) and calls plugins by name. It handles optional arguments by signature inspection, returns a list for one-to-many hook calls, supports hook ordering and wrapping, lets plugins register more hooks, and allows runtime register/unregister. Examples include a requests-based demo that lets plugins mutate headers and a CLI that lets plugins add arguments and manage a session. The package is pre-1.0 and uses semantic versioning.
AI-written summary · about
chapters (5)
- 0:00Start
- 7:57THE PLUGIN MANAGER
- 11:59CALLING THE HOOK
- 22:28HANDLING COMMAND LINE ARGUMENTS
- 24:31PY.TEST HOOKS
related talks
27mWhy I use py.test and maybe you should too
37mTesting your Plone codebase with Pytest
26mHow to Write Pytest Plugins
23mQt and Python; code easily using the Pytest framework
23mTwister V2: New Framework for Testing Based on Pytest. Overview & Current Status
30mHow to build a unit testing library from scratch?
32mpytest for unittesters
33mForcing unittest to function
